aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gregtech/common/blocks
diff options
context:
space:
mode:
authorPrometheus0000 <prometheus0000000@gmail.com>2021-02-11 14:29:19 -0500
committerGitHub <noreply@github.com>2021-02-11 14:29:19 -0500
commit3a027e939e2c18e165b2f1405637c92f25736582 (patch)
tree1d75209cd6c074313f0e3f15bc989f7b258a57bd /src/main/java/gregtech/common/blocks
parentc6324633a4491296c0505e59aa7f8747af0c640a (diff)
parente0c1f654b17d901d018603912bf32c32bd136bad (diff)
downloadGT5-Unofficial-3a027e939e2c18e165b2f1405637c92f25736582.tar.gz
GT5-Unofficial-3a027e939e2c18e165b2f1405637c92f25736582.tar.bz2
GT5-Unofficial-3a027e939e2c18e165b2f1405637c92f25736582.zip
Merge pull request #23 from GTNewHorizons/experimental
update
Diffstat (limited to 'src/main/java/gregtech/common/blocks')
-rw-r--r--src/main/java/gregtech/common/blocks/GT_Block_Concretes.java25
-rw-r--r--src/main/java/gregtech/common/blocks/GT_Block_Metal.java5
-rw-r--r--src/main/java/gregtech/common/blocks/GT_Block_Reinforced.java4
-rw-r--r--src/main/java/gregtech/common/blocks/GT_Block_Stones_Abstract.java4
-rw-r--r--src/main/java/gregtech/common/blocks/GT_Item_Machines.java28
5 files changed, 20 insertions, 46 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 0c24227ad3..2641b9db44 100644
--- a/src/main/java/gregtech/common/blocks/GT_Block_Concretes.java
+++ b/src/main/java/gregtech/common/blocks/GT_Block_Concretes.java
@@ -72,29 +72,4 @@ public class GT_Block_Concretes extends GT_Block_Stones_Abstract implements IBlo
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())) {
- if (aEntity.isSneaking()) {
- aEntity.motionX *= 0.8999999761581421D;
- aEntity.motionZ *= 0.8999999761581421D;
- } else {
- if (aEntity.motionX < 6.0 && aEntity.motionZ < 6.0) {
- aEntity.motionX *= 1.100000023841858D;
- aEntity.motionZ *= 1.100000023841858D;
- }
- }
- }
- }
-
- public AxisAlignedBB getCollisionBoundingBoxFromPool(World aWorld, int aX, int aY, int aZ) {
- Block tBlock = aWorld.getBlock(aX, aY + 1, aZ);
- if (((tBlock instanceof IFluidBlock)) || ((tBlock instanceof BlockLiquid))) {
- return super.getCollisionBoundingBoxFromPool(aWorld, aX, aY, aZ);
- }
- return AxisAlignedBB.getBoundingBox(aX, aY, aZ, aX + 1, aY + 0.875D, aZ + 1);
- }
- **/
}
diff --git a/src/main/java/gregtech/common/blocks/GT_Block_Metal.java b/src/main/java/gregtech/common/blocks/GT_Block_Metal.java
index abcc92a795..1d0e4a2cd5 100644
--- a/src/main/java/gregtech/common/blocks/GT_Block_Metal.java
+++ b/src/main/java/gregtech/common/blocks/GT_Block_Metal.java
@@ -15,13 +15,14 @@ public class GT_Block_Metal extends GT_Block_Storage {
public OrePrefixes mPrefix;
public IIconContainer[] mBlockIcons;
public boolean mHideBlocks;
+ public static boolean mNEIisLoaded = Loader.isModLoaded("NotEnoughItems");
public GT_Block_Metal(String aName, Materials[] aMats, OrePrefixes aPrefix, IIconContainer[] aBlockIcons) {
super(GT_Item_Storage.class, aName, Material.iron);
mMats = aMats;
mPrefix = aPrefix;
mBlockIcons = aBlockIcons;
- mHideBlocks = Loader.isModLoaded("NotEnoughItems");
+ mHideBlocks = mNEIisLoaded;
for (int i = 0; i < aMats.length; i++) {
if (aMats[i].mMetaItemSubID > 0 && aMats[i].mHasParentMod) {
@@ -29,7 +30,7 @@ public class GT_Block_Metal extends GT_Block_Storage {
GT_OreDictUnificator.registerOre(aPrefix, aMats[i], new ItemStack(this, 1, i));
}
}
- if (aMats.length<16 && Loader.isModLoaded("NotEnoughItems")) {
+ if (aMats.length<16 && mNEIisLoaded) {
for (int i = aMats.length; i < 16; i++) codechicken.nei.api.API.hideItem(new ItemStack(this, 1, i));
}
}
diff --git a/src/main/java/gregtech/common/blocks/GT_Block_Reinforced.java b/src/main/java/gregtech/common/blocks/GT_Block_Reinforced.java
index ec31cb212c..6b3b0823fb 100644
--- a/src/main/java/gregtech/common/blocks/GT_Block_Reinforced.java
+++ b/src/main/java/gregtech/common/blocks/GT_Block_Reinforced.java
@@ -69,10 +69,6 @@ public class GT_Block_Reinforced extends GT_Generic_Block {
ItemList.Block_NaquadahPlate.set(new ItemStack(this.setHardness(500.0f).setResistance(1000.0f), 1, 10));
ItemList.Block_NeutroniumPlate.set(new ItemStack(this.setHardness(750.0f).setResistance(2500.0f), 1, 11));
ItemList.Block_BedrockiumCompressed.set(new ItemStack(this.setHardness(1500.0f).setResistance(5000.0f), 1, 12));
- //GT_ModHandler.addCraftingRecipe(ItemList.Block_BronzePlate.get(1L, new Object[0]),GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"hP ", "PBP", " P ", 'P', OrePrefixes.plate.get(Materials.Bronze), 'B', OrePrefixes.stone.get(Materials.GraniteBlack)});
- //GT_ModHandler.addCraftingRecipe(ItemList.Block_BronzePlate.get(1L, new Object[0]),GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"hP ", "PBP", " P ", 'P', OrePrefixes.plate.get(Materials.Bronze), 'B', OrePrefixes.stone.get(Materials.GraniteRed)});
- //GT_ModHandler.addCraftingRecipe(ItemList.Block_IridiumTungstensteel.get(1L, new Object[0]),GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"hBP", 'P', OrePrefixes.plate.get(Materials.Iridium), 'B', ItemList.Block_TungstenSteelReinforced.get(1L, new Object[0])});
- //GT_OreDictUnificator.setItemData(ItemList.Block_IridiumTungstensteel.get(1, new Object[0]), new ItemData(new MaterialStack(Materials.Iridium, OrePrefixes.plate.mMaterialAmount), new MaterialStack(Materials.TungstenSteel, 2*OrePrefixes.plate.mMaterialAmount),new MaterialStack(Materials.Concrete, OrePrefixes.dust.mMaterialAmount)));
GT_ModHandler.addShapelessCraftingRecipe(new ItemStack(Items.coal, 1, 1), new Object[]{ItemList.Block_BrittleCharcoal.get(1, new Object[0])});
GT_ModHandler.addCraftingRecipe(ItemList.Block_Powderbarrel.get(1L, new Object[0]),GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"WSW","GGG","WGW", 'W', OrePrefixes.plate.get(Materials.Wood), 'G', new ItemStack(Items.gunpowder,1),'S',new ItemStack(Items.string,1)});
diff --git a/src/main/java/gregtech/common/blocks/GT_Block_Stones_Abstract.java b/src/main/java/gregtech/common/blocks/GT_Block_Stones_Abstract.java
index c9c31dae54..5297847e0a 100644
--- a/src/main/java/gregtech/common/blocks/GT_Block_Stones_Abstract.java
+++ b/src/main/java/gregtech/common/blocks/GT_Block_Stones_Abstract.java
@@ -24,9 +24,7 @@ import net.minecraft.world.World;
import java.util.List;
import java.util.Random;
-public class GT_Block_Stones_Abstract
- extends GT_Generic_Block
- implements IOreRecipeRegistrator {
+public class GT_Block_Stones_Abstract extends GT_Generic_Block implements IOreRecipeRegistrator {
public GT_Block_Stones_Abstract(Class<? extends ItemBlock> aItemClass, String aName) {
super(aItemClass, aName, Material.rock);
OrePrefixes.crafting.add(this);
diff --git a/src/main/java/gregtech/common/blocks/GT_Item_Machines.java b/src/main/java/gregtech/common/blocks/GT_Item_Machines.java
index 917f31f9ce..61879a2253 100644
--- a/src/main/java/gregtech/common/blocks/GT_Item_Machines.java
+++ b/src/main/java/gregtech/common/blocks/GT_Item_Machines.java
@@ -4,7 +4,9 @@ import gregtech.api.GregTech_API;
import gregtech.api.enums.GT_Values;
import gregtech.api.enums.Materials;
import gregtech.api.interfaces.metatileentity.IConnectable;
+import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import gregtech.api.metatileentity.MetaTileEntity;
import gregtech.api.metatileentity.implementations.GT_MetaPipeEntity_Cable;
import gregtech.api.metatileentity.implementations.GT_MetaPipeEntity_Fluid;
import gregtech.api.metatileentity.implementations.GT_MetaPipeEntity_Frame;
@@ -45,20 +47,22 @@ public class GT_Item_Machines extends ItemBlock {
IGregTechTileEntity tTileEntity = GregTech_API.METATILEENTITIES[tDamage].getBaseMetaTileEntity();
if (tTileEntity.getDescription() != null) {
int i = 0;
+ IMetaTileEntity metaTileEntity = tTileEntity.getMetaTileEntity();
+ String suffix = (metaTileEntity instanceof MetaTileEntity && ((MetaTileEntity) metaTileEntity).isDisplaySecondaryDescription()) ? "Secondary_" : "";
for (String tDescription : tTileEntity.getDescription()) {
if (GT_Utility.isStringValid(tDescription)) {
- if(tDescription.contains("%%%")){
- String[] tString = tDescription.split("%%%");
- if(tString.length>=2){
- StringBuffer tBuffer = new StringBuffer();
- Object tRep[] = new String[tString.length / 2];
- for (int j = 0; j < tString.length; j++)
- if (j % 2 == 0) tBuffer.append(tString[j]);
- else {tBuffer.append(" %s"); tRep[j / 2] = tString[j];}
- aList.add(String.format(GT_LanguageManager.addStringLocalization("TileEntity_DESCRIPTION_" + tDamage + "_Index_" + i++, tBuffer.toString(), !GregTech_API.sPostloadFinished), tRep));
- }
- }else{String tTranslated = GT_LanguageManager.addStringLocalization("TileEntity_DESCRIPTION_" + tDamage + "_Index_" + i++, tDescription, !GregTech_API.sPostloadFinished );
- aList.add(tTranslated.equals("") ? tDescription : tTranslated);}
+ if(tDescription.contains("%%%")){
+ String[] tString = tDescription.split("%%%");
+ if(tString.length>=2){
+ StringBuffer tBuffer = new StringBuffer();
+ Object tRep[] = new String[tString.length / 2];
+ for (int j = 0; j < tString.length; j++)
+ if (j % 2 == 0) tBuffer.append(tString[j]);
+ else {tBuffer.append(" %s"); tRep[j / 2] = tString[j];}
+ aList.add(String.format(GT_LanguageManager.addStringLocalization("TileEntity_" + suffix + "DESCRIPTION_" + tDamage + "_Index_" + i++, tBuffer.toString(), !GregTech_API.sPostloadFinished ), tRep));
+ }
+ }else{String tTranslated = GT_LanguageManager.addStringLocalization("TileEntity_" + suffix + "DESCRIPTION_" + tDamage + "_Index_" + i++, tDescription, !GregTech_API.sPostloadFinished );
+ aList.add(tTranslated.equals("") ? tDescription : tTranslated);}
}else i++;
}
}