aboutsummaryrefslogtreecommitdiff
path: root/src/Java/gtPlusPlus/core
diff options
context:
space:
mode:
Diffstat (limited to 'src/Java/gtPlusPlus/core')
-rw-r--r--src/Java/gtPlusPlus/core/material/MaterialGenerator.java24
-rw-r--r--src/Java/gtPlusPlus/core/recipe/RECIPES_GREGTECH.java54
-rw-r--r--src/Java/gtPlusPlus/core/tileentities/general/TileEntityFishTrap.java127
3 files changed, 119 insertions, 86 deletions
diff --git a/src/Java/gtPlusPlus/core/material/MaterialGenerator.java b/src/Java/gtPlusPlus/core/material/MaterialGenerator.java
index 0b6848846b..6e529b3e92 100644
--- a/src/Java/gtPlusPlus/core/material/MaterialGenerator.java
+++ b/src/Java/gtPlusPlus/core/material/MaterialGenerator.java
@@ -19,8 +19,15 @@ import gtPlusPlus.core.material.state.MaterialState;
import gtPlusPlus.core.util.Utils;
import gtPlusPlus.core.util.fluid.FluidUtils;
import gtPlusPlus.core.util.item.ItemUtils;
-import gtPlusPlus.xmod.gregtech.api.enums.GregtechOrePrefixes.GT_Materials;
-import gtPlusPlus.xmod.gregtech.loaders.*;
+import gtPlusPlus.xmod.gregtech.loaders.RecipeGen_AlloySmelter;
+import gtPlusPlus.xmod.gregtech.loaders.RecipeGen_Assembler;
+import gtPlusPlus.xmod.gregtech.loaders.RecipeGen_BlastSmelter;
+import gtPlusPlus.xmod.gregtech.loaders.RecipeGen_DustGeneration;
+import gtPlusPlus.xmod.gregtech.loaders.RecipeGen_Extruder;
+import gtPlusPlus.xmod.gregtech.loaders.RecipeGen_Fluids;
+import gtPlusPlus.xmod.gregtech.loaders.RecipeGen_Plates;
+import gtPlusPlus.xmod.gregtech.loaders.RecipeGen_Recycling;
+import gtPlusPlus.xmod.gregtech.loaders.RecipeGen_ShapedCrafting;
import net.minecraft.block.Block;
import net.minecraft.item.Item;
@@ -49,7 +56,7 @@ public class MaterialGenerator {
}
int sRadiation = 0;
- if (ItemUtils.isRadioactive(materialName) || matInfo.vRadiationLevel != 0){
+ if (ItemUtils.isRadioactive(materialName) || (matInfo.vRadiationLevel != 0)){
sRadiation = matInfo.vRadiationLevel;
}
@@ -121,7 +128,7 @@ public class MaterialGenerator {
temp = new BaseItemNugget(matInfo);
temp = new BaseItemPlate(matInfo);
temp = new BaseItemPlateDouble(matInfo);
- }
+ }
else if (matInfo.getState() == MaterialState.PURE_LIQUID){
FluidUtils.generateFluidNoPrefix(unlocalizedName, materialName, matInfo.getMeltingPointK(), C);
return true;
@@ -138,8 +145,9 @@ public class MaterialGenerator {
RecipeGen_Fluids.generateRecipes(matInfo);
RecipeGen_Plates.generateRecipes(matInfo);
RecipeGen_ShapedCrafting.generateRecipes(matInfo);
+ RecipeGen_Recycling.generateRecipes(matInfo);
return true;
- } catch (Throwable t)
+ } catch (final Throwable t)
{
Utils.LOG_INFO(""+matInfo.getLocalizedName()+" failed to generate.");
return false;
@@ -158,7 +166,7 @@ public class MaterialGenerator {
}
int sRadiation = 0;
- if (ItemUtils.isRadioactive(materialName) || matInfo.vRadiationLevel != 0){
+ if (ItemUtils.isRadioactive(materialName) || (matInfo.vRadiationLevel != 0)){
sRadiation = matInfo.vRadiationLevel;
}
@@ -172,6 +180,7 @@ public class MaterialGenerator {
//Add A jillion Recipes - old code
RecipeGen_DustGeneration.addMixerRecipe_Standalone(matInfo);
RecipeGen_Fluids.generateRecipes(matInfo);
+ //RecipeGen_Recycling.generateRecipes(matInfo);
}
public static void generateNuclearMaterial(final Material matInfo){
@@ -209,7 +218,8 @@ public class MaterialGenerator {
RecipeGen_Fluids.generateRecipes(matInfo);
RecipeGen_Assembler.generateRecipes(matInfo);
RecipeGen_DustGeneration.generateRecipes(matInfo, true);
- } catch (Throwable t){
+ RecipeGen_Recycling.generateRecipes(matInfo);
+ } catch (final Throwable t){
Utils.LOG_INFO(""+matInfo.getLocalizedName()+" failed to generate.");
}
}
diff --git a/src/Java/gtPlusPlus/core/recipe/RECIPES_GREGTECH.java b/src/Java/gtPlusPlus/core/recipe/RECIPES_GREGTECH.java
index 4f83afa197..365218e28e 100644
--- a/src/Java/gtPlusPlus/core/recipe/RECIPES_GREGTECH.java
+++ b/src/Java/gtPlusPlus/core/recipe/RECIPES_GREGTECH.java
@@ -280,18 +280,6 @@ public class RECIPES_GREGTECH {
120);
}
-
-
-
-
-
-
-
-
-
-
-
-
//TungstenCarbide
if (Materials.get("TungstenCarbide") != null){
CORE.RA.addBlastSmelterRecipe(
@@ -332,9 +320,49 @@ public class RECIPES_GREGTECH {
},
FluidUtils.getFluidStack("molten.darksteel", 2*144),
0,
- MathUtils.findPercentageOfInt(500*20, 80),
+ MathUtils.findPercentageOfInt(200*20, 80),
120);
}
+ //Pulsating Iron
+ if (ItemUtils.getItemStackOfAmountFromOreDict("dustIron", 1) != ItemUtils.getSimpleStack(ModItems.AAA_Broken)){
+ CORE.RA.addBlastSmelterRecipe(
+ new ItemStack[]{
+ ItemUtils.getGregtechCircuit(2),
+ ItemUtils.getItemStackOfAmountFromOreDict("dustIron", 1),
+ ItemUtils.getSimpleStack(Items.ender_pearl)
+ },
+ FluidUtils.getFluidStack("molten.pulsatingiron", 2*144),
+ 0,
+ MathUtils.findPercentageOfInt(8*20, 80),
+ 120);
+ }
+ //Energetic Alloy
+ if (ItemUtils.getItemStackOfAmountFromOreDict("dustEnergeticAlloy", 1) != ItemUtils.getSimpleStack(ModItems.AAA_Broken)){
+ CORE.RA.addBlastSmelterRecipe(
+ new ItemStack[]{
+ ItemUtils.getGregtechCircuit(12),
+ ItemUtils.getItemStackOfAmountFromOreDict("dustIron", 1),
+ ItemUtils.getSimpleStack(Items.glowstone_dust)
+ },
+ FluidUtils.getFluidStack("molten.redstone", 144),
+ FluidUtils.getFluidStack("molten.energeticalloy", 144),
+ 0,
+ MathUtils.findPercentageOfInt(9*20, 80),
+ 120);
+ }
+ //Vibrant Alloy
+ if (ItemUtils.getItemStackOfAmountFromOreDict("dustVibrantAlloy", 1) != ItemUtils.getSimpleStack(ModItems.AAA_Broken)){
+ CORE.RA.addBlastSmelterRecipe(
+ new ItemStack[]{
+ ItemUtils.getGregtechCircuit(12),
+ ItemUtils.getItemStackOfAmountFromOreDict("dustEnergeticAlloy", 1),
+ ItemUtils.getSimpleStack(Items.ender_pearl)
+ },
+ FluidUtils.getFluidStack("molten.vibrantalloy", 144),
+ 0,
+ MathUtils.findPercentageOfInt(16*20, 80),
+ 480);
+ }
}
diff --git a/src/Java/gtPlusPlus/core/tileentities/general/TileEntityFishTrap.java b/src/Java/gtPlusPlus/core/tileentities/general/TileEntityFishTrap.java
index bd2f8b727c..d73de219e4 100644
--- a/src/Java/gtPlusPlus/core/tileentities/general/TileEntityFishTrap.java
+++ b/src/Java/gtPlusPlus/core/tileentities/general/TileEntityFishTrap.java
@@ -9,7 +9,6 @@ import gtPlusPlus.core.lib.LoadedMods;
import gtPlusPlus.core.util.Utils;
import gtPlusPlus.core.util.item.ItemUtils;
import gtPlusPlus.core.util.math.MathUtils;
-import gtPlusPlus.xmod.gregtech.api.objects.XSTR;
import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
@@ -101,24 +100,24 @@ public class TileEntityFishTrap extends TileEntity implements ISidedInventory {
int checkingSlot = 0;
final ItemStack loot = this.generateLootForFishTrap().copy();
try {
- //Utils.LOG_INFO("Trying to add "+loot.getDisplayName()+" | "+loot.getItemDamage());
+ //Utils.LOG_WARNING("Trying to add "+loot.getDisplayName()+" | "+loot.getItemDamage());
for (final ItemStack contents : this.getInventory().getInventory()) {
if (GT_Utility.areStacksEqual(loot, contents)){
if (contents.stackSize < contents.getMaxStackSize()) {
- //Utils.LOG_INFO("3-Trying to add one more "+loot.getDisplayName()+"meta: "+loot.getItemDamage()+" to an existing stack of "+contents.getDisplayName()+" with a size of "+contents.stackSize);
+ //Utils.LOG_WARNING("3-Trying to add one more "+loot.getDisplayName()+"meta: "+loot.getItemDamage()+" to an existing stack of "+contents.getDisplayName()+" with a size of "+contents.stackSize);
contents.stackSize++;
this.markDirty();
- return true;
+ return true;
}
}
checkingSlot++;
}
checkingSlot = 0;
for (final ItemStack contents : this.getInventory().getInventory()) {
- if (contents == null) {
- //Utils.LOG_INFO("Adding Item To Empty Slot. "+(checkingSlot+1));
+ if (contents == null) {
+ //Utils.LOG_WARNING("Adding Item To Empty Slot. "+(checkingSlot+1));
this.getInventory().setInventorySlotContents(checkingSlot, loot);
this.markDirty();
return true;
@@ -126,7 +125,7 @@ public class TileEntityFishTrap extends TileEntity implements ISidedInventory {
checkingSlot++;
}
}
- catch (NullPointerException n) {
+ catch (final NullPointerException n) {
}
}
this.markDirty();
@@ -142,9 +141,12 @@ public class TileEntityFishTrap extends TileEntity implements ISidedInventory {
else if (lootWeight <= 10) {
loot = ItemUtils.getSimpleStack(Items.bone);
}
- else if (lootWeight <= 20) {
+ else if (lootWeight <= 15) {
loot = ItemUtils.getSimpleStack(Blocks.sand);
}
+ else if (lootWeight <= 20) {
+ loot = ItemUtils.simpleMetaStack(Items.dye, 0, 1);
+ }
// Junk Loot
else if (lootWeight <= 23) {
if (LoadedMods.PamsHarvestcraft) {
@@ -156,12 +158,12 @@ public class TileEntityFishTrap extends TileEntity implements ISidedInventory {
}
// Pam Fish
else if (lootWeight <= 99) {
- Random xstr = new Random();
+ final Random xstr = new Random();
loot = FishingHooks.getRandomFishable(xstr, 100);
}
else if (lootWeight == 100){
- int rareLoot = MathUtils.randInt(1, 10);
+ final int rareLoot = MathUtils.randInt(1, 10);
if (rareLoot <= 4) {
loot = ItemUtils.getItemStackOfAmountFromOreDictNoBroken("nuggetIron", 1);
if (loot == null){
@@ -173,7 +175,7 @@ public class TileEntityFishTrap extends TileEntity implements ISidedInventory {
if (loot == null){
loot = ItemUtils.getItemStackOfAmountFromOreDictNoBroken("ingotGold", 1);
}
- }
+ }
else if (rareLoot <= 9){
loot = ItemUtils.getSimpleStack(Items.emerald);
}
@@ -192,47 +194,47 @@ public class TileEntityFishTrap extends TileEntity implements ISidedInventory {
@Override
public void updateEntity() {
try{
- if (!this.worldObj.isRemote) {
- this.tickCount++;
- // Utils.LOG_WARNING("Ticking "+this.tickCount);
- // Check if the Tile is within water once per second.
- if ((this.tickCount % 20) == 0) {
- this.isInWater = this.isSurroundedByWater();
- }
- else {
-
- }
+ if (!this.worldObj.isRemote) {
+ this.tickCount++;
+ // Utils.LOG_WARNING("Ticking "+this.tickCount);
+ // Check if the Tile is within water once per second.
+ if ((this.tickCount % 20) == 0) {
+ this.isInWater = this.isSurroundedByWater();
+ }
+ else {
- if (this.isInWater) {
- this.calculateTickrate();
- }
+ }
- // Try add some loot once every 30 seconds.
- if ((this.tickCount % this.baseTickRate) == 0) {
if (this.isInWater) {
- // Add loot
- // Utils.LOG_WARNING("Adding Loot to the fishtrap at
- // x["+this.locationX+"] y["+this.locationY+"]
- // z["+this.locationZ+"] (Ticking for loot every
- // "+this.baseTickRate+" ticks)");
- this.tryAddLoot();
- this.markDirty();
+ this.calculateTickrate();
}
- else {
- Utils.LOG_INFO("This Trap does not have enough water around it.");
- Utils.LOG_WARNING("Not adding Loot to the fishtrap at x[" + this.locationX + "] y[" + this.locationY
- + "] z[" + this.locationZ + "] (Ticking for loot every " + this.baseTickRate + " ticks)");
- this.markDirty();
+
+ // Try add some loot once every 30 seconds.
+ if ((this.tickCount % this.baseTickRate) == 0) {
+ if (this.isInWater) {
+ // Add loot
+ // Utils.LOG_WARNING("Adding Loot to the fishtrap at
+ // x["+this.locationX+"] y["+this.locationY+"]
+ // z["+this.locationZ+"] (Ticking for loot every
+ // "+this.baseTickRate+" ticks)");
+ this.tryAddLoot();
+ this.markDirty();
+ }
+ else {
+ Utils.LOG_WARNING("This Trap does not have enough water around it.");
+ Utils.LOG_WARNING("Not adding Loot to the fishtrap at x[" + this.locationX + "] y[" + this.locationY
+ + "] z[" + this.locationZ + "] (Ticking for loot every " + this.baseTickRate + " ticks)");
+ this.markDirty();
+ }
+ this.tickCount = 0;
+ }
+ if (this.tickCount > (this.baseTickRate + 500)) {
+ this.tickCount = 0;
}
- this.tickCount = 0;
- }
- if (this.tickCount > (this.baseTickRate + 500)) {
- this.tickCount = 0;
- }
+ }
}
- }
- catch (Throwable t){}
+ catch (final Throwable t){}
}
public void calculateTickrate() {
@@ -293,13 +295,6 @@ public class TileEntityFishTrap extends TileEntity implements ISidedInventory {
"Crayfish", "Eel", "Frog", "Grouper", "Herring", "Jellyfish", "Mudfish", "Octopus", "Perch", "Scallop",
"Shrimp", "Snail", "Snapper", "Tilapia", "Trout", "Tuna", "Turtle", "Walleye" };
- private static final ItemStack[] minecraftFish = {
- ItemUtils.simpleMetaStack(Items.fish, 0, 1).copy(),
- ItemUtils.simpleMetaStack(Items.fish, 1, 1).copy(),
- ItemUtils.simpleMetaStack(Items.fish, 2, 1).copy(),
- ItemUtils.simpleMetaStack(Items.fish, 3, 1).copy()
- };
-
public static void pamsHarvestCraftCompat() {
for (int i = 0; i < harvestcraftFish.length; i++) {
@@ -312,22 +307,22 @@ public class TileEntityFishTrap extends TileEntity implements ISidedInventory {
}
@Override
- public ItemStack getStackInSlot(int slot) {
+ public ItemStack getStackInSlot(final int slot) {
return this.getInventory().getStackInSlot(slot);
}
@Override
- public ItemStack decrStackSize(int slot, int count) {
+ public ItemStack decrStackSize(final int slot, final int count) {
return this.getInventory().decrStackSize(slot, count);
}
@Override
- public ItemStack getStackInSlotOnClosing(int slot) {
+ public ItemStack getStackInSlotOnClosing(final int slot) {
return this.getInventory().getStackInSlotOnClosing(slot);
}
@Override
- public void setInventorySlotContents(int slot, ItemStack stack) {
+ public void setInventorySlotContents(final int slot, final ItemStack stack) {
this.getInventory().setInventorySlotContents(slot, stack);
}
@@ -337,7 +332,7 @@ public class TileEntityFishTrap extends TileEntity implements ISidedInventory {
}
@Override
- public boolean isUseableByPlayer(EntityPlayer entityplayer) {
+ public boolean isUseableByPlayer(final EntityPlayer entityplayer) {
return this.getInventory().isUseableByPlayer(entityplayer);
}
@@ -346,7 +341,7 @@ public class TileEntityFishTrap extends TileEntity implements ISidedInventory {
this.worldObj.addBlockEvent(this.xCoord, this.yCoord, this.zCoord, this.getBlockType(), 1, 1);
this.worldObj.notifyBlocksOfNeighborChange(this.xCoord, this.yCoord, this.zCoord, this.getBlockType());
this.worldObj.notifyBlocksOfNeighborChange(this.xCoord, this.yCoord - 1, this.zCoord, this.getBlockType());
- this.getInventory().openInventory();
+ this.getInventory().openInventory();
}
@Override
@@ -354,17 +349,17 @@ public class TileEntityFishTrap extends TileEntity implements ISidedInventory {
this.worldObj.addBlockEvent(this.xCoord, this.yCoord, this.zCoord, this.getBlockType(), 1, 1);
this.worldObj.notifyBlocksOfNeighborChange(this.xCoord, this.yCoord, this.zCoord, this.getBlockType());
this.worldObj.notifyBlocksOfNeighborChange(this.xCoord, this.yCoord - 1, this.zCoord, this.getBlockType());
- this.getInventory().closeInventory();
+ this.getInventory().closeInventory();
}
@Override
- public boolean isItemValidForSlot(int slot, ItemStack itemstack) {
+ public boolean isItemValidForSlot(final int slot, final ItemStack itemstack) {
return this.getInventory().isItemValidForSlot(slot, itemstack);
}
@Override
- public int[] getAccessibleSlotsFromSide(int p_94128_1_) {
- int[] accessibleSides = new int[this.getSizeInventory()];
+ public int[] getAccessibleSlotsFromSide(final int p_94128_1_) {
+ final int[] accessibleSides = new int[this.getSizeInventory()];
for (int r=0; r<this.getInventory().getSizeInventory(); r++){
accessibleSides[r]=r;
}
@@ -373,12 +368,12 @@ public class TileEntityFishTrap extends TileEntity implements ISidedInventory {
}
@Override
- public boolean canInsertItem(int p_102007_1_, ItemStack p_102007_2_, int p_102007_3_) {
+ public boolean canInsertItem(final int p_102007_1_, final ItemStack p_102007_2_, final int p_102007_3_) {
return false;
}
@Override
- public boolean canExtractItem(int p_102008_1_, ItemStack p_102008_2_, int p_102008_3_) {
+ public boolean canExtractItem(final int p_102008_1_, final ItemStack p_102008_2_, final int p_102008_3_) {
return true;
}
@@ -386,7 +381,7 @@ public class TileEntityFishTrap extends TileEntity implements ISidedInventory {
return this.customName;
}
- public void setCustomName(String customName) {
+ public void setCustomName(final String customName) {
this.customName = customName;
}
@@ -397,7 +392,7 @@ public class TileEntityFishTrap extends TileEntity implements ISidedInventory {
@Override
public boolean hasCustomInventoryName() {
- return this.customName != null && !this.customName.equals("");
+ return (this.customName != null) && !this.customName.equals("");
}
}