This repository has been archived by the owner on Sep 9, 2022. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
+fixed heated water pump Signed-off-by: bartimaeusnek <[email protected]>
- Loading branch information
1 parent
5c6f706
commit 381122f
Showing
9 changed files
with
196 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
92 changes: 92 additions & 0 deletions
92
...n/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedSmallOreTE.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
package com.github.bartimaeusnek.bartworks.system.material; | ||
|
||
import gregtech.api.GregTech_API; | ||
import gregtech.api.enums.Materials; | ||
import gregtech.api.enums.OrePrefixes; | ||
import gregtech.api.interfaces.ITexture; | ||
import gregtech.api.objects.GT_CopiedBlockTexture; | ||
import gregtech.api.objects.GT_RenderedTexture; | ||
import gregtech.api.objects.XSTR; | ||
import gregtech.api.util.GT_OreDictUnificator; | ||
import gregtech.api.util.GT_Utility; | ||
import gregtech.common.blocks.GT_Block_Ores_Abstract; | ||
import net.minecraft.block.Block; | ||
import net.minecraft.init.Blocks; | ||
import net.minecraft.item.ItemStack; | ||
|
||
import java.util.ArrayList; | ||
import java.util.Random; | ||
|
||
public class BW_MetaGeneratedSmallOreTE extends BW_MetaGeneratedOreTE { | ||
|
||
@Override | ||
public ArrayList<ItemStack> getDrops(Block aDroppedOre) { | ||
ArrayList<ItemStack> rList = new ArrayList<>(); | ||
Materials aMaterial = Werkstoff.werkstoffHashMap.get(this.mMetaData).getBridgeMaterial(); | ||
|
||
if (aMaterial != null) { | ||
Random tRandom = new XSTR(this.xCoord ^ this.yCoord ^ this.zCoord); | ||
ArrayList<ItemStack> tSelector = new ArrayList<>(); | ||
|
||
ItemStack tStack = GT_OreDictUnificator.get(OrePrefixes.gemExquisite, aMaterial, GT_OreDictUnificator.get(OrePrefixes.gem, aMaterial, 1L), 1L); | ||
if (tStack != null) { | ||
for (int i = 0; i < 1; i++) { | ||
tSelector.add(tStack); | ||
} | ||
} | ||
tStack = GT_OreDictUnificator.get(OrePrefixes.gemFlawless, aMaterial, GT_OreDictUnificator.get(OrePrefixes.gem, aMaterial, 1L), 1L); | ||
if (tStack != null) { | ||
for (int i = 0; i < 2; i++) { | ||
tSelector.add(tStack); | ||
} | ||
} | ||
tStack = GT_OreDictUnificator.get(OrePrefixes.gem, aMaterial, 1L); | ||
if (tStack != null) { | ||
for (int i = 0; i < 12; i++) { | ||
tSelector.add(tStack); | ||
} | ||
} | ||
tStack = GT_OreDictUnificator.get(OrePrefixes.gemFlawed, aMaterial, GT_OreDictUnificator.get(OrePrefixes.crushed, aMaterial, 1L), 1L); | ||
if (tStack != null) { | ||
for (int i = 0; i < 5; i++) { | ||
tSelector.add(tStack); | ||
} | ||
} | ||
tStack = GT_OreDictUnificator.get(OrePrefixes.crushed, aMaterial, 1L); | ||
if (tStack != null) { | ||
for (int i = 0; i < 10; i++) { | ||
tSelector.add(tStack); | ||
} | ||
} | ||
tStack = GT_OreDictUnificator.get(OrePrefixes.gemChipped, aMaterial, GT_OreDictUnificator.get(OrePrefixes.dustImpure, aMaterial, 1L), 1L); | ||
if (tStack != null) { | ||
for (int i = 0; i < 5; i++) { | ||
tSelector.add(tStack); | ||
} | ||
} | ||
tStack = GT_OreDictUnificator.get(OrePrefixes.dustImpure, aMaterial, 1L); | ||
if (tStack != null) { | ||
for (int i = 0; i < 10; i++) { | ||
tSelector.add(tStack); | ||
} | ||
} | ||
if (tSelector.size() > 0) { | ||
rList.add(GT_Utility.copyAmount(1L, tSelector.get(tRandom.nextInt(tSelector.size())))); | ||
} | ||
if (tRandom.nextInt(3) > 1) { | ||
rList.add(GT_OreDictUnificator.get(tRandom.nextInt(3) > 0 ? OrePrefixes.dustImpure : OrePrefixes.dust, Materials.Stone, 1L)); | ||
} | ||
} | ||
return rList; | ||
} | ||
|
||
@Override | ||
public ITexture[] getTexture(Block aBlock, byte aSide) { | ||
Werkstoff aMaterial = Werkstoff.werkstoffHashMap.get(this.mMetaData); | ||
if ((aMaterial != null)) { | ||
GT_RenderedTexture aIconSet = new GT_RenderedTexture(aMaterial.getTexSet().mTextures[OrePrefixes.oreSmall.mTextureIndex], aMaterial.getRGBA()); | ||
return new ITexture[]{new GT_CopiedBlockTexture(Blocks.stone, 0, 0), aIconSet}; | ||
} | ||
return new ITexture[]{new GT_CopiedBlockTexture(Blocks.stone, 0, 0), new GT_RenderedTexture(gregtech.api.enums.TextureSet.SET_NONE.mTextures[OrePrefixes.oreSmall.mTextureIndex])}; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
63 changes: 63 additions & 0 deletions
63
...n/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_SmallOres.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
package com.github.bartimaeusnek.bartworks.system.material; | ||
|
||
import gregtech.api.enums.OrePrefixes; | ||
import gregtech.api.util.GT_LanguageManager; | ||
import gregtech.api.util.GT_ModHandler; | ||
import net.minecraft.block.Block; | ||
import net.minecraft.block.material.Material; | ||
import net.minecraft.init.Blocks; | ||
import net.minecraft.tileentity.TileEntity; | ||
import net.minecraft.world.World; | ||
|
||
import java.util.Arrays; | ||
|
||
public class BW_MetaGenerated_SmallOres extends BW_MetaGenerated_Ores { | ||
public BW_MetaGenerated_SmallOres(Material p_i45386_1_, Class<? extends TileEntity> tileEntity, String blockName) { | ||
super(p_i45386_1_, tileEntity, blockName); | ||
} | ||
|
||
@Override | ||
protected void doRegistrationStuff(Werkstoff w) { | ||
if (w != null) { | ||
if ((w.getGenerationFeatures().toGenerate & 0b1000) == 0 || ((w.getGenerationFeatures().blacklist & 0b1000) != 0)) | ||
return; | ||
GT_ModHandler.addValuableOre(this, w.getmID(), 1); | ||
GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + "." + w.getmID() + ".name", OrePrefixes.oreSmall.mLocalizedMaterialPre + w.getDefaultName() + OrePrefixes.oreSmall.mLocalizedMaterialPost); | ||
} | ||
} | ||
|
||
@Override | ||
public String getUnlocalizedName() { | ||
return "bw.blockores.02"; | ||
} | ||
|
||
public static boolean setOreBlock(World aWorld, int aX, int aY, int aZ, int aMetaData, boolean air, Block block, int[] aBlockMeta) { | ||
if (!air) { | ||
aY = Math.min(aWorld.getActualHeight(), Math.max(aY, 1)); | ||
} | ||
|
||
Block tBlock = aWorld.getBlock(aX, aY, aZ); | ||
Block tOreBlock = WerkstoffLoader.BWSmallOres; | ||
if (aMetaData < 0 || tBlock == Blocks.air && !air) { | ||
return false; | ||
} else { | ||
|
||
if (Block.getIdFromBlock(tBlock) != Block.getIdFromBlock(block)) { | ||
return false; | ||
} | ||
final int aaY = aY; | ||
if (Arrays.stream(aBlockMeta).noneMatch(e -> e == aWorld.getBlockMetadata(aX, aaY, aZ))) { | ||
return false; | ||
} | ||
|
||
aWorld.setBlock(aX, aY, aZ, tOreBlock, aMetaData, 0); | ||
TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); | ||
if (tTileEntity instanceof BW_MetaGeneratedOreTE) { | ||
((BW_MetaGeneratedOreTE) tTileEntity).mMetaData = (short) aMetaData; | ||
} | ||
|
||
return true; | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters