aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gregtech/api
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/gregtech/api')
-rw-r--r--src/main/java/gregtech/api/enums/Materials.java10
-rw-r--r--src/main/java/gregtech/api/interfaces/IToolStats.java1
-rw-r--r--src/main/java/gregtech/api/items/GT_MetaGenerated_Tool.java34
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicBatteryBuffer.java3
4 files changed, 42 insertions, 6 deletions
diff --git a/src/main/java/gregtech/api/enums/Materials.java b/src/main/java/gregtech/api/enums/Materials.java
index ea708c8562..44ce17cd45 100644
--- a/src/main/java/gregtech/api/enums/Materials.java
+++ b/src/main/java/gregtech/api/enums/Materials.java
@@ -176,7 +176,7 @@ public enum Materials implements IColorModulationContainer, ISubTagContainer {
DiamondCopper ( -1, TextureSet.SET_NONE , 1.0F, 0, 2, 1|2 , 255, 255, 255, 0, "Diamond Copper" , 0, 0, -1, 0, false, false, 3, 1, 1, Dyes._NULL ),
SodiumPeroxide ( -1, TextureSet.SET_NONE , 1.0F, 0, 2, 1 , 255, 255, 255, 0, "Sodium Peroxide" , 0, 0, -1, 0, false, false, 3, 1, 1, Dyes._NULL ),
IridiumSodiumOxide ( -1, TextureSet.SET_NONE , 1.0F, 0, 2, 1 , 255, 255, 255, 0, "Iridium Sodium Oxide" , 0, 0, -1, 0, false, false, 3, 1, 1, Dyes._NULL ),
- PlatinumGroupSludge ( 241, TextureSet.SET_POWDER , 1.0F, 0, 2, 1 , 0, 30, 0, 0, "Platinum Group Sluge" , 0, 0, -1, 0, false, false, 3, 1, 1, Dyes._NULL ),
+ PlatinumGroupSludge ( 241, TextureSet.SET_POWDER , 1.0F, 0, 2, 1 , 0, 30, 0, 0, "Platinum Group Sludge" , 0, 0, -1, 0, false, false, 3, 1, 1, Dyes._NULL ),
Fairy ( -1, TextureSet.SET_NONE , 1.0F, 0, 2, 1|2 , 255, 255, 255, 0, "Fairy" , 0, 0, -1, 0, false, false, 3, 1, 1, Dyes._NULL ),
Ludicrite ( -1, TextureSet.SET_NONE , 1.0F, 0, 2, 1|2 , 255, 255, 255, 0, "Ludicrite" , 0, 0, -1, 0, false, false, 3, 1, 1, Dyes._NULL ),
Pokefennium ( -1, TextureSet.SET_NONE , 1.0F, 0, 2, 1|2 , 255, 255, 255, 0, "Pokefennium" , 0, 0, -1, 0, false, false, 3, 1, 1, Dyes._NULL ),
@@ -468,7 +468,7 @@ public enum Materials implements IColorModulationContainer, ISubTagContainer {
Rutile ( 375, TextureSet.SET_GEM_HORIZONTAL , 1.0F, 0, 2, 1 |8 , 212, 13, 92, 0, "Rutile" , 0, 0, -1, 0, false, false, 1, 2, 1, Dyes.dyeRed , 0, Arrays.asList(new MaterialStack(Titanium, 1), new MaterialStack(Oxygen, 2))),
Bauxite ( 822, TextureSet.SET_DULL , 1.0F, 0, 1, 1 |8 , 200, 100, 0, 0, "Bauxite" , 0, 0, -1, 0, false, false, 3, 1, 1, Dyes.dyeBrown , 1, Arrays.asList(new MaterialStack(Rutile, 2), new MaterialStack(Aluminium, 16), new MaterialStack(Hydrogen, 10), new MaterialStack(Oxygen, 11))),
Titaniumtetrachloride( 376, TextureSet.SET_FLUID , 1.0F, 0, 2, 16 , 212, 13, 92, 0, "Titaniumtetrachloride" , 0, 0, -1, 0, false, false, 1, 1, 1, Dyes.dyeRed , 0, Arrays.asList(new MaterialStack(Titanium, 1), new MaterialStack(Carbon, 2), new MaterialStack(Chlorine, 2))),
- Magnesiumchloride ( 377, TextureSet.SET_DULL , 1.0F, 0, 2, 1|16 , 212, 13, 92, 0, "Magnesiumchloride" , 0, 0, -1, 0, false, false, 1, 1, 1, Dyes.dyeRed , 0, Arrays.asList(new MaterialStack(Magnesium, 1), new MaterialStack(Chlorine, 1))),
+ Magnesiumchloride ( 377, TextureSet.SET_DULL , 1.0F, 0, 2, 1|16 , 212, 13, 92, 0, "Magnesiumchloride" , 0, 0, -1, 0, false, false, 1, 1, 1, Dyes.dyeRed , 0, Arrays.asList(new MaterialStack(Magnesium, 1), new MaterialStack(Chlorine, 2))),
Invar ( 302, TextureSet.SET_METALLIC , 6.0F, 256, 2, 1|2 |64|128 , 180, 180, 120, 0, "Invar" , 0, 0, -1, 0, false, false, 1, 1, 1, Dyes.dyeBrown , 2, Arrays.asList(new MaterialStack(Iron, 2), new MaterialStack(Nickel, 1)), Arrays.asList(new TC_AspectStack(TC_Aspects.METALLUM, 2), new TC_AspectStack(TC_Aspects.GELUM, 1))),
IronCompressed ( -1, TextureSet.SET_METALLIC , 7.0F, 96, 1, 1|2 |64|128 , 128, 128, 128, 0, "Compressed Iron" , 0, 0, -1, 0, false, false, 1, 1, 1, Dyes.dyeGray , 2, Arrays.asList(new MaterialStack(Iron, 1))),
Kanthal ( 312, TextureSet.SET_METALLIC , 6.0F, 64, 2, 1|2 |64 , 194, 210, 223, 0, "Kanthal" , 0, 0, 1800, 1800, true, false, 1, 1, 1, Dyes.dyeYellow , 2, Arrays.asList(new MaterialStack(Iron, 1), new MaterialStack(Aluminium, 1), new MaterialStack(Chrome, 1))),
@@ -485,7 +485,7 @@ public enum Materials implements IColorModulationContainer, ISubTagContainer {
Obsidian ( 804, TextureSet.SET_DULL , 1.0F, 0, 3, 1 , 80, 50, 100, 0, "Obsidian" , 0, 0, -1, 0, false, false, 1, 1, 1, Dyes.dyeBlack , 1, Arrays.asList(new MaterialStack(Magnesium, 1), new MaterialStack(Iron, 1), new MaterialStack(Silicon, 2), new MaterialStack(Oxygen, 8))),
Phosphate ( 833, TextureSet.SET_DULL , 1.0F, 0, 1, 1 |8|16 , 255, 255, 0, 0, "Phosphate" , 0, 0, -1, 0, false, false, 2, 1, 1, Dyes.dyeYellow , 1, Arrays.asList(new MaterialStack(Phosphor, 1), new MaterialStack(Oxygen, 4))),
PigIron ( 307, TextureSet.SET_METALLIC , 6.0F, 384, 2, 1|2 |8 |64 , 200, 180, 180, 0, "Pig Iron" , 0, 0, -1, 0, false, false, 3, 1, 1, Dyes.dyePink , 2, Arrays.asList(new MaterialStack(Iron, 1))),
- Plastic ( 874, TextureSet.SET_DULL , 3.0F, 32, 1, 1|2 |64|128 , 200, 200, 200, 0, "Polyethylen" , 0, 0, 400, 0, false, false, 1, 1, 1, Dyes.dyeWhite , 0, Arrays.asList(new MaterialStack(Carbon, 1), new MaterialStack(Hydrogen, 2)), Arrays.asList(new TC_AspectStack(TC_Aspects.MOTUS, 2))),
+ Plastic ( 874, TextureSet.SET_DULL , 3.0F, 32, 1, 1|2 |64|128 , 200, 200, 200, 0, "Polyethylene" , 0, 0, 400, 0, false, false, 1, 1, 1, Dyes.dyeWhite , 0, Arrays.asList(new MaterialStack(Carbon, 1), new MaterialStack(Hydrogen, 2)), Arrays.asList(new TC_AspectStack(TC_Aspects.MOTUS, 2))),
Epoxid ( 470, TextureSet.SET_DULL , 3.0F, 32, 1, 1|2 |64|128 , 200, 140, 20, 0, "Epoxid" , 0, 0, 400, 0, false, false, 1, 1, 1, Dyes.dyeWhite , 0, Arrays.asList(new MaterialStack(Carbon, 2), new MaterialStack(Hydrogen, 4), new MaterialStack(Oxygen, 1)), Arrays.asList(new TC_AspectStack(TC_Aspects.MOTUS, 2))),
Silicone ( 471, TextureSet.SET_DULL , 3.0F, 32, 1, 1|2 |64|128 , 220, 220, 220, 0, "Silicone" , 0, 0, 900, 0, false, false, 1, 1, 1, Dyes.dyeWhite , 0, Arrays.asList(new MaterialStack(Carbon, 1), new MaterialStack(Hydrogen, 1), new MaterialStack(Silicon, 2), new MaterialStack(Oxygen, 1)), Arrays.asList(new TC_AspectStack(TC_Aspects.MOTUS, 2))),
Polycaprolactam ( 472, TextureSet.SET_DULL , 3.0F, 32, 1, 1|2 |64|128 , 50, 50, 50, 0, "Polycaprolactam" , 0, 0, 500, 0, false, false, 1, 1, 1, Dyes.dyeWhite , 0, Arrays.asList(new MaterialStack(Carbon, 6), new MaterialStack(Hydrogen, 11), new MaterialStack(Nitrogen, 1), new MaterialStack(Oxygen, 1)), Arrays.asList(new TC_AspectStack(TC_Aspects.MOTUS, 2))),
@@ -508,8 +508,8 @@ public enum Materials implements IColorModulationContainer, ISubTagContainer {
Snow ( 728, TextureSet.SET_FINE , 1.0F, 0, 0, 1| 16 , 250, 250, 250, 0, "Snow" , 0, 0, -1, 0, false, false, 1, 1, 1, Dyes.dyeWhite , 0, Arrays.asList(new MaterialStack(Hydrogen, 2), new MaterialStack(Oxygen, 1)), Arrays.asList(new TC_AspectStack(TC_Aspects.GELUM, 1))),
Sodalite ( 525, TextureSet.SET_LAPIS , 1.0F, 0, 1, 1 |4|8 , 20, 20, 255, 0, "Sodalite" , 0, 0, -1, 0, false, false, 3, 1, 1, Dyes.dyeBlue , 1, Arrays.asList(new MaterialStack(Aluminium, 3), new MaterialStack(Silicon, 3), new MaterialStack(Sodium, 4), new MaterialStack(Chlorine, 1))),
SodiumPersulfate ( 718, TextureSet.SET_FLUID , 1.0F, 0, 2, 16 , 255, 255, 255, 0, "Sodium Persulfate" , 0, 0, -1, 0, false, false, 1, 1, 1, Dyes.dyeOrange , 1, Arrays.asList(new MaterialStack(Sodium, 1), new MaterialStack(Sulfur, 1), new MaterialStack(Oxygen, 4))),
- SodiumSulfide ( 719, TextureSet.SET_FLUID , 1.0F, 0, 2, 16 , 255, 255, 255, 0, "Sodium Sulfide" , 0, 0, -1, 0, false, false, 1, 1, 1, Dyes.dyeOrange , 1, Arrays.asList(new MaterialStack(Sodium, 1), new MaterialStack(Sulfur, 1))),
- HydricSulfide ( 460, TextureSet.SET_FLUID , 1.0F, 0, 2, 16 , 255, 255, 255, 0, "Hydric Sulfide" , 0, 0, -1, 0, false, false, 1, 1, 1, Dyes.dyeOrange , 0, Arrays.asList(new MaterialStack(Hydrogen, 1), new MaterialStack(Sulfur, 1))),
+ SodiumSulfide ( 719, TextureSet.SET_FLUID , 1.0F, 0, 2, 16 , 255, 255, 255, 0, "Sodium Sulfide" , 0, 0, -1, 0, false, false, 1, 1, 1, Dyes.dyeOrange , 1, Arrays.asList(new MaterialStack(Sodium, 2), new MaterialStack(Sulfur, 1))),
+ HydricSulfide ( 460, TextureSet.SET_FLUID , 1.0F, 0, 2, 16 , 255, 255, 255, 0, "Hydrogen Sulfide" , 0, 0, -1, 0, false, false, 1, 1, 1, Dyes.dyeOrange , 0, Arrays.asList(new MaterialStack(Hydrogen, 2), new MaterialStack(Sulfur, 1))),
OilHeavy ( 730, TextureSet.SET_FLUID , 1.0F, 0, 0, 16 , 10, 10, 10, 0, "Heavy Oil" , 3, 32, -1, 0, false, false, 1, 1, 1, Dyes.dyeBlack ),
OilMedium ( 731, TextureSet.SET_FLUID , 1.0F, 0, 0, 16 , 10, 10, 10, 0, "Raw Oil" , 3, 24, -1, 0, false, false, 1, 1, 1, Dyes.dyeBlack ),
diff --git a/src/main/java/gregtech/api/interfaces/IToolStats.java b/src/main/java/gregtech/api/interfaces/IToolStats.java
index fc0df8a89b..3c03bb8563 100644
--- a/src/main/java/gregtech/api/interfaces/IToolStats.java
+++ b/src/main/java/gregtech/api/interfaces/IToolStats.java
@@ -102,6 +102,7 @@ public interface IToolStats {
*/
public boolean isGrafter();
+ public boolean isChainsaw();
/**
* @return If this Tool can be used as an BC Wrench.
*/
diff --git a/src/main/java/gregtech/api/items/GT_MetaGenerated_Tool.java b/src/main/java/gregtech/api/items/GT_MetaGenerated_Tool.java
index 702ab4ee96..5bbf4d0729 100644
--- a/src/main/java/gregtech/api/items/GT_MetaGenerated_Tool.java
+++ b/src/main/java/gregtech/api/items/GT_MetaGenerated_Tool.java
@@ -24,6 +24,7 @@ import net.minecraft.enchantment.EnchantmentHelper;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.SharedMonsterAttributes;
+import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.item.EntityMinecart;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.EnumAction;
@@ -37,6 +38,7 @@ import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.IIcon;
import net.minecraft.util.MathHelper;
import net.minecraft.world.World;
+import net.minecraftforge.common.IShearable;
import net.minecraftforge.event.world.BlockEvent;
import java.util.ArrayList;
@@ -209,6 +211,38 @@ public abstract class GT_MetaGenerated_Tool extends GT_MetaBase_Item implements
if (isItemStackUsable(aStack) && getDigSpeed(aStack, aBlock, aMetaData) > 0.0F)
doDamage(aStack, tStats.convertBlockDrops(aDrops, aStack, aPlayer, aBlock, aX, aY, aZ, aMetaData, aFortune, aSilkTouch, aEvent) * tStats.getToolDamagePerDropConversion());
}
+
+ @Override
+ public boolean onBlockStartBreak(ItemStack aStack, int aX, int aY, int aZ, EntityPlayer aPlayer)
+ {
+ if(aPlayer.worldObj.isRemote){
+ return false;
+ }
+ IToolStats tStats = getToolStats(aStack);
+ Block aBlock = aPlayer.worldObj.getBlock(aX, aY, aZ);
+ if (tStats.isChainsaw()&&(aBlock instanceof IShearable))
+ {
+ IShearable target = (IShearable)aBlock;
+ if ((target.isShearable(aStack, aPlayer.worldObj, aX, aY, aZ)))
+ {
+ ArrayList<ItemStack> drops = target.onSheared(aStack, aPlayer.worldObj, aX, aY, aZ, EnchantmentHelper.getEnchantmentLevel(Enchantment.fortune.effectId, aStack));
+ for (ItemStack stack : drops)
+ {
+ float f = 0.7F;
+ double d = itemRand.nextFloat() * f + (1.0F - f) * 0.5D;
+ double d1 = itemRand.nextFloat() * f + (1.0F - f) * 0.5D;
+ double d2 = itemRand.nextFloat() * f + (1.0F - f) * 0.5D;
+ EntityItem entityitem = new EntityItem(aPlayer.worldObj, aX + d, aY + d1, aZ + d2, stack);
+ entityitem.delayBeforeCanPickup = 10;
+ aPlayer.worldObj.spawnEntityInWorld(entityitem);
+ }
+ aPlayer.addStat(net.minecraft.stats.StatList.mineBlockStatArray[Block.getIdFromBlock(aBlock)], 1);
+ onBlockDestroyed(aStack, aPlayer.worldObj, aBlock, aX, aY, aZ, aPlayer);
+ }
+ return false;
+ }
+ return super.onBlockStartBreak(aStack, aX, aY, aZ, aPlayer);
+ }
@Override
public boolean onLeftClickEntity(ItemStack aStack, EntityPlayer aPlayer, Entity aEntity) {
diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicBatteryBuffer.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicBatteryBuffer.java
index b76440fad2..7091e70ab2 100644
--- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicBatteryBuffer.java
+++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicBatteryBuffer.java
@@ -244,7 +244,8 @@ public class GT_MetaTileEntity_BasicBatteryBuffer extends GT_MetaTileEntity_Tier
name.equals("gt.metaitem.01.32521") ||
name.equals("gt.metaitem.01.32530") ||
name.equals("gt.metaitem.01.32531")) {
- return true;
+ if(ic2.api.item.ElectricItem.manager.getCharge(aStack)==0){
+ return true;}
}
}
return false;