aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gregtech/common/blocks
diff options
context:
space:
mode:
authorAntifluxfield <lyj_299792458@163.com>2017-12-12 21:10:29 +0800
committerAntifluxfield <lyj_299792458@163.com>2017-12-12 21:10:29 +0800
commit22fb5955b0356a9b174312a6300348446a523f5c (patch)
tree594feea7970baa612d517d19a1fcb95144ab369f /src/main/java/gregtech/common/blocks
parent0cce0e6a1af627fe536aa11097373c17547c242b (diff)
parent79999604ecb7795cafca5dac21f8df33f8da62ee (diff)
downloadGT5-Unofficial-22fb5955b0356a9b174312a6300348446a523f5c.tar.gz
GT5-Unofficial-22fb5955b0356a9b174312a6300348446a523f5c.tar.bz2
GT5-Unofficial-22fb5955b0356a9b174312a6300348446a523f5c.zip
Merge remote-tracking branch 'origin/experimental' into GT6-pipes
Diffstat (limited to 'src/main/java/gregtech/common/blocks')
-rw-r--r--src/main/java/gregtech/common/blocks/GT_Block_Concretes.java15
-rw-r--r--src/main/java/gregtech/common/blocks/GT_TileEntity_Ores.java57
2 files changed, 36 insertions, 36 deletions
diff --git a/src/main/java/gregtech/common/blocks/GT_Block_Concretes.java b/src/main/java/gregtech/common/blocks/GT_Block_Concretes.java
index 6f3f80c7df..402f50a484 100644
--- a/src/main/java/gregtech/common/blocks/GT_Block_Concretes.java
+++ b/src/main/java/gregtech/common/blocks/GT_Block_Concretes.java
@@ -2,6 +2,7 @@ package gregtech.common.blocks;
import gregtech.api.enums.Materials;
import gregtech.api.enums.OrePrefixes;
+import gregtech.api.interfaces.IBlockOnWalkOver;
import gregtech.api.util.GT_LanguageManager;
import gregtech.api.util.GT_OreDictUnificator;
import net.minecraft.block.Block;
@@ -16,11 +17,11 @@ import net.minecraft.world.World;
import net.minecraftforge.fluids.IFluidBlock;
public class GT_Block_Concretes
- extends GT_Block_Stones_Abstract {
+ extends GT_Block_Stones_Abstract implements IBlockOnWalkOver{
public GT_Block_Concretes() {
super(GT_Item_Concretes.class, "gt.blockconcretes");
setResistance(20.0F);
- this.slipperiness = 0.9F;
+ //this.slipperiness = 0.9F;
GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".0.name", "Dark Concrete");
GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".1.name", "Dark Concrete Cobblestone");
GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".2.name", "Mossy Dark Concrete Cobblestone");
@@ -70,6 +71,15 @@ public class GT_Block_Concretes
return gregtech.api.enums.Textures.BlockIcons.CONCRETES[0].getIcon();
}
+ @Override
+ public void onWalkOver(EntityLivingBase aEntity, World aWorld, int aX, int aY, int aZ) {
+ if ((aEntity.motionX != 0 || aEntity.motionZ != 0) && !aEntity.isInWater() && !aEntity.isWet() && !aEntity.isSneaking()) {
+ double tSpeed = (aWorld.getBlock(aX, aY-1, aZ).slipperiness >= 0.8 ? 1.5 : 1.2);
+ aEntity.motionX *= tSpeed; aEntity.motionZ *= tSpeed;
+ }
+ }
+
+ /**
public void onEntityCollidedWithBlock(World aWorld, int aX, int aY, int aZ, Entity aEntity) {
Block tBlock = aWorld.getBlock(aX, aY + 1, aZ);
if (((aEntity instanceof EntityLivingBase)) && (!(tBlock instanceof IFluidBlock)) && (!(tBlock instanceof BlockLiquid)) && (aEntity.onGround) && (!aEntity.isInWater()) && (!aEntity.isWet())) {
@@ -92,4 +102,5 @@ public class GT_Block_Concretes
}
return AxisAlignedBB.getBoundingBox(aX, aY, aZ, aX + 1, aY + 0.875D, aZ + 1);
}
+ **/
}
diff --git a/src/main/java/gregtech/common/blocks/GT_TileEntity_Ores.java b/src/main/java/gregtech/common/blocks/GT_TileEntity_Ores.java
index c6618dca60..f8b52c8f08 100644
--- a/src/main/java/gregtech/common/blocks/GT_TileEntity_Ores.java
+++ b/src/main/java/gregtech/common/blocks/GT_TileEntity_Ores.java
@@ -31,7 +31,7 @@ public class GT_TileEntity_Ores extends TileEntity implements ITexturedTileEntit
public static byte getHarvestData(short aMetaData, int aBaseBlockHarvestLevel) {
Materials aMaterial = GregTech_API.sGeneratedMaterials[(aMetaData % 1000)];
byte tByte = aMaterial == null ? 0 : (byte) Math.max(aBaseBlockHarvestLevel, Math.min(7, aMaterial.mToolQuality - (aMetaData < 16000 ? 0 : 1)));
- if(GT_Mod.gregtechproxy.mChangeHarvestLevels ){
+ if(GT_Mod.gregtechproxy.mChangeHarvestLevels ) {
tByte = aMaterial == null ? 0 : (byte) Math.max(aBaseBlockHarvestLevel, Math.min(GT_Mod.gregtechproxy.mMaxHarvestLevel, GT_Mod.gregtechproxy.mHarvestLevel[aMaterial.mMetaItemSubID] - (aMetaData < 16000 ? 0 : 1)));
}
return tByte;
@@ -51,38 +51,9 @@ public class GT_TileEntity_Ores extends TileEntity implements ITexturedTileEntit
String BlockName = tBlock.getUnlocalizedName();
aMetaData += isSmallOre ? 16000 : 0;
if ((aMetaData > 0) && ((tBlock != Blocks.air) || air)) {
- if (BlockName.equals("tile.igneousStone")) {
- if (GregTech_API.sBlockOresUb1 != null) {
- tOreBlock = GregTech_API.sBlockOresUb1;
- aMetaData += (BlockMeta * 1000);
- //System.out.println("Block changed to UB1");
- }
- } else if (BlockName.equals("tile.metamorphicStone")) {
- if (GregTech_API.sBlockOresUb2 != null) {
- tOreBlock = GregTech_API.sBlockOresUb2;
- aMetaData += (BlockMeta * 1000);
- //System.out.println("Block changed to UB2");
- }
- } else if (BlockName.equals("tile.sedimentaryStone")) {
- if (GregTech_API.sBlockOresUb3 != null) {
- tOreBlock = GregTech_API.sBlockOresUb3;
- aMetaData += (BlockMeta * 1000);
- //System.out.println("Block changed to UB3");
- }
- //} else if (BlockName.equals("tile.moonBlock") && (BlockMeta == 3 || BlockMeta == 4)) {
- // if (GregTech_API.sBlockOresGC != null) {
- // switch (BlockMeta) {
- // case 3: tOreBlock = GregTech_API.sBlockOresGC; break;
- // case 4: aMetaData += 1000; tOreBlock = GregTech_API.sBlockOresGC; break;
- // }
- // }
- //} else if (BlockName.equals("tile.mars") && (BlockMeta == 6 || BlockMeta == 9)) {
- // if (GregTech_API.sBlockOresGC != null) {
- // switch (BlockMeta) {
- // case 6: aMetaData += 2000; tOreBlock = GregTech_API.sBlockOresGC; break;
- // case 9: aMetaData += 3000; tOreBlock = GregTech_API.sBlockOresGC; break;
- // }
- // }
+ if (tBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, Blocks.stone)) {
+ //Do nothing, stone background is default background.
+ //Do this comparison first since stone is most common
} else if (tBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, Blocks.netherrack)) {
aMetaData += 1000;
} else if (tBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, Blocks.end_stone)) {
@@ -107,7 +78,25 @@ public class GT_TileEntity_Ores extends TileEntity implements ITexturedTileEntit
} else {
aMetaData += 5000;
}
- } else if (!tBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, Blocks.stone)) {
+ } else if (BlockName.equals("tile.igneousStone")) {
+ if (GregTech_API.sBlockOresUb1 != null) {
+ tOreBlock = GregTech_API.sBlockOresUb1;
+ aMetaData += (BlockMeta * 1000);
+ //System.out.println("Block changed to UB1");
+ }
+ } else if (BlockName.equals("tile.metamorphicStone")) {
+ if (GregTech_API.sBlockOresUb2 != null) {
+ tOreBlock = GregTech_API.sBlockOresUb2;
+ aMetaData += (BlockMeta * 1000);
+ //System.out.println("Block changed to UB2");
+ }
+ } else if (BlockName.equals("tile.sedimentaryStone")) {
+ if (GregTech_API.sBlockOresUb3 != null) {
+ tOreBlock = GregTech_API.sBlockOresUb3;
+ aMetaData += (BlockMeta * 1000);
+ //System.out.println("Block changed to UB3");
+ }
+ } else {
return false;
}
//System.out.println(tOreBlock);