Skip to content

Commit

Permalink
the renaming (#73)
Browse files Browse the repository at this point in the history
  • Loading branch information
NotAPenguin0 authored Sep 3, 2024
1 parent 6293ab8 commit 67b65a4
Show file tree
Hide file tree
Showing 10 changed files with 298 additions and 301 deletions.
2 changes: 1 addition & 1 deletion dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ dependencies {
api("com.github.GTNewHorizons:CropLoadCore:0.2.0:dev")
api("net.industrial-craft:industrialcraft-2:2.2.828-experimental:dev")

devOnlyNonPublishable("com.github.GTNewHorizons:GT5-Unofficial:5.09.49.29:dev")
devOnlyNonPublishable("com.github.GTNewHorizons:GT5-Unofficial:5.09.49.56:dev")
compileOnly(deobf("https://media.forgecdn.net/files/2499/612/BiomesOPlenty-1.7.10-2.1.0.2308-universal.jar"))
compileOnly("com.github.GTNewHorizons:twilightforest:2.6.33:dev") {
transitive = false
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
package com.github.bartimaeusnek.cropspp.GTHandler;

import static gregtech.api.enums.GT_Values.W;
import static gregtech.api.enums.GTValues.W;

import net.minecraft.block.Block;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;

import gregtech.api.interfaces.IItemContainer;
import gregtech.api.util.GT_ModHandler;
import gregtech.api.util.GT_OreDictUnificator;
import gregtech.api.util.GT_Utility;
import gregtech.api.util.GTModHandler;
import gregtech.api.util.GTOreDictUnificator;
import gregtech.api.util.GTUtility;

public enum CropItemList implements IItemContainer {

Expand Down Expand Up @@ -53,14 +53,14 @@ public IItemContainer set(Item aItem) {
return this;
}
ItemStack aStack = new ItemStack(aItem, 1, 0);
mStack = GT_Utility.copyAmount(1, aStack);
mStack = GTUtility.copyAmount(1, aStack);
return this;
}

@Override
public IItemContainer set(ItemStack aStack) {
mHasNotBeenSet = false;
mStack = GT_Utility.copyAmount(1, aStack);
mStack = GTUtility.copyAmount(1, aStack);
return this;
}

Expand All @@ -69,7 +69,7 @@ public Item getItem() {
if (mHasNotBeenSet) {
throw new IllegalAccessError("The Enum '" + name() + "' has not been set to an Item at this time!");
}
if (GT_Utility.isStackInvalid(mStack)) {
if (GTUtility.isStackInvalid(mStack)) {
return null;
}
return mStack.getItem();
Expand All @@ -80,7 +80,7 @@ public Block getBlock() {
if (mHasNotBeenSet) {
throw new IllegalAccessError("The Enum '" + name() + "' has not been set to an Item at this time!");
}
return GT_Utility.getBlockFromItem(getItem());
return GTUtility.getBlockFromItem(getItem());
}

@Override
Expand All @@ -95,83 +95,83 @@ public boolean isStackEqual(Object aStack) {

@Override
public boolean isStackEqual(Object aStack, boolean aWildcard, boolean aIgnoreNBT) {
return !GT_Utility.isStackInvalid(aStack)
&& GT_Utility.areUnificationsEqual((ItemStack) aStack, aWildcard ? getWildcard(1) : get(1), aIgnoreNBT);
return !GTUtility.isStackInvalid(aStack)
&& GTUtility.areUnificationsEqual((ItemStack) aStack, aWildcard ? getWildcard(1) : get(1), aIgnoreNBT);
}

@Override
public ItemStack get(long aAmount, Object... aReplacements) {
if (mHasNotBeenSet) {
throw new IllegalAccessError("The Enum '" + name() + "' has not been set to an Item at this time!");
}
if (GT_Utility.isStackInvalid(mStack)) {
return GT_Utility.copyAmount(aAmount, aReplacements);
if (GTUtility.isStackInvalid(mStack)) {
return GTUtility.copyAmount(aAmount, aReplacements);
}
return GT_Utility.copyAmount(aAmount, GT_OreDictUnificator.get(mStack));
return GTUtility.copyAmount(aAmount, GTOreDictUnificator.get(mStack));
}

@Override
public ItemStack getWildcard(long aAmount, Object... aReplacements) {
if (mHasNotBeenSet) {
throw new IllegalAccessError("The Enum '" + name() + "' has not been set to an Item at this time!");
}
if (GT_Utility.isStackInvalid(mStack)) {
return GT_Utility.copyAmount(aAmount, aReplacements);
if (GTUtility.isStackInvalid(mStack)) {
return GTUtility.copyAmount(aAmount, aReplacements);
}
return GT_Utility.copyAmountAndMetaData(aAmount, W, GT_OreDictUnificator.get(mStack));
return GTUtility.copyAmountAndMetaData(aAmount, W, GTOreDictUnificator.get(mStack));
}

@Override
public ItemStack getUndamaged(long aAmount, Object... aReplacements) {
if (mHasNotBeenSet) {
throw new IllegalAccessError("The Enum '" + name() + "' has not been set to an Item at this time!");
}
if (GT_Utility.isStackInvalid(mStack)) {
return GT_Utility.copyAmount(aAmount, aReplacements);
if (GTUtility.isStackInvalid(mStack)) {
return GTUtility.copyAmount(aAmount, aReplacements);
}
return GT_Utility.copyAmountAndMetaData(aAmount, 0, GT_OreDictUnificator.get(mStack));
return GTUtility.copyAmountAndMetaData(aAmount, 0, GTOreDictUnificator.get(mStack));
}

@Override
public ItemStack getAlmostBroken(long aAmount, Object... aReplacements) {
if (mHasNotBeenSet) {
throw new IllegalAccessError("The Enum '" + name() + "' has not been set to an Item at this time!");
}
if (GT_Utility.isStackInvalid(mStack)) {
return GT_Utility.copyAmount(aAmount, aReplacements);
if (GTUtility.isStackInvalid(mStack)) {
return GTUtility.copyAmount(aAmount, aReplacements);
}
return GT_Utility.copyAmountAndMetaData(aAmount, mStack.getMaxDamage() - 1, GT_OreDictUnificator.get(mStack));
return GTUtility.copyAmountAndMetaData(aAmount, mStack.getMaxDamage() - 1, GTOreDictUnificator.get(mStack));
}

@Override
public ItemStack getWithName(long aAmount, String aDisplayName, Object... aReplacements) {
ItemStack rStack = get(1, aReplacements);
if (GT_Utility.isStackInvalid(rStack)) {
if (GTUtility.isStackInvalid(rStack)) {
return null;
}
rStack.setStackDisplayName(aDisplayName);
return GT_Utility.copyAmount(aAmount, rStack);
return GTUtility.copyAmount(aAmount, rStack);
}

@Override
public ItemStack getWithCharge(long aAmount, int aEnergy, Object... aReplacements) {
ItemStack rStack = get(1, aReplacements);
if (GT_Utility.isStackInvalid(rStack)) {
if (GTUtility.isStackInvalid(rStack)) {
return null;
}
GT_ModHandler.chargeElectricItem(rStack, aEnergy, Integer.MAX_VALUE, true, false);
return GT_Utility.copyAmount(aAmount, rStack);
GTModHandler.chargeElectricItem(rStack, aEnergy, Integer.MAX_VALUE, true, false);
return GTUtility.copyAmount(aAmount, rStack);
}

@Override
public ItemStack getWithDamage(long aAmount, long aMetaValue, Object... aReplacements) {
if (mHasNotBeenSet) {
throw new IllegalAccessError("The Enum '" + name() + "' has not been set to an Item at this time!");
}
if (GT_Utility.isStackInvalid(mStack)) {
return GT_Utility.copyAmount(aAmount, aReplacements);
if (GTUtility.isStackInvalid(mStack)) {
return GTUtility.copyAmount(aAmount, aReplacements);
}
return GT_Utility.copyAmountAndMetaData(aAmount, aMetaValue, GT_OreDictUnificator.get(mStack));
return GTUtility.copyAmountAndMetaData(aAmount, aMetaValue, GTOreDictUnificator.get(mStack));
}

@Override
Expand All @@ -180,7 +180,7 @@ public IItemContainer registerOre(Object... aOreNames) {
throw new IllegalAccessError("The Enum '" + name() + "' has not been set to an Item at this time!");
}
for (Object tOreName : aOreNames) {
GT_OreDictUnificator.registerOre(tOreName, get(1));
GTOreDictUnificator.registerOre(tOreName, get(1));
}
return this;
}
Expand All @@ -191,7 +191,7 @@ public IItemContainer registerWildcardAsOre(Object... aOreNames) {
throw new IllegalAccessError("The Enum '" + name() + "' has not been set to an Item at this time!");
}
for (Object tOreName : aOreNames) {
GT_OreDictUnificator.registerOre(tOreName, getWildcard(1));
GTOreDictUnificator.registerOre(tOreName, getWildcard(1));
}
return this;
}
Expand Down
Loading

0 comments on commit 67b65a4

Please sign in to comment.