-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migrate Dyson from GalaxySpace to Intergalactic (#89)
- Loading branch information
1 parent
a16c8e9
commit 3b570fc
Showing
55 changed files
with
1,052 additions
and
70 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
85 changes: 85 additions & 0 deletions
85
src/main/java/com/gtnewhorizons/gtnhintergalactic/block/BlockCasingDysonSwarm.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,85 @@ | ||
package com.gtnewhorizons.gtnhintergalactic.block; | ||
|
||
import java.util.List; | ||
|
||
import net.minecraft.block.Block; | ||
import net.minecraft.block.material.Material; | ||
import net.minecraft.client.renderer.texture.IIconRegister; | ||
import net.minecraft.creativetab.CreativeTabs; | ||
import net.minecraft.entity.Entity; | ||
import net.minecraft.entity.EntityLivingBase; | ||
import net.minecraft.item.Item; | ||
import net.minecraft.item.ItemStack; | ||
import net.minecraft.util.IIcon; | ||
import net.minecraft.world.World; | ||
|
||
import com.gtnewhorizons.gtnhintergalactic.GTNHIntergalactic; | ||
|
||
public class BlockCasingDysonSwarm extends Block { | ||
|
||
private IIcon[][] textures; | ||
public static final String[] names = { "ReceiverCasing", "ReceiverDish", "DeploymentUnitCasing", | ||
"DeploymentUnitCore", "DeploymentUnitMagnet", "ControlCasing", "ControlPrimary", "ControlSecondary", | ||
"ControlToroid", "Floor" }; | ||
|
||
public BlockCasingDysonSwarm() { | ||
super(Material.iron); | ||
setBlockName("DysonSwarmPart"); | ||
setCreativeTab(GTNHIntergalactic.tab); | ||
setHarvestLevel("pickaxe", 2); | ||
} | ||
|
||
@Override | ||
public void registerBlockIcons(IIconRegister register) { | ||
textures = new IIcon[names.length][2]; | ||
for (int i = 0; i < names.length; i++) { | ||
textures[i][0] = register | ||
.registerIcon(GTNHIntergalactic.ASSET_PREFIX + ":dysonSwarm/" + names[i] + "_Side"); | ||
textures[i][1] = register.registerIcon(GTNHIntergalactic.ASSET_PREFIX + ":dysonSwarm/" + names[i]); | ||
} | ||
} | ||
|
||
@Override | ||
public IIcon getIcon(int side, int meta) { | ||
return textures[meta % textures.length][side < 2 ? 1 : 0]; | ||
} | ||
|
||
@Override | ||
public void getSubBlocks(Item item, CreativeTabs tab, List variants) { | ||
for (int i = 0; i < names.length; i++) { | ||
variants.add(new ItemStack(item, 1, i)); | ||
} | ||
} | ||
|
||
@Override | ||
public float getExplosionResistance(Entity entity, World world, int x, int y, int z, double explosionX, | ||
double explosionY, double explosionZ) { | ||
if (world.getBlockMetadata(x, y, z) == 9) { | ||
return 1500.0f; | ||
} | ||
return 6.0f; | ||
} | ||
|
||
@Override | ||
public float getExplosionResistance(Entity entity) { | ||
return 6.0f; | ||
} | ||
|
||
@Override | ||
public float getBlockHardness(World world, int x, int y, int z) { | ||
if (world.getBlockMetadata(x, y, z) == 9) { | ||
return 800.0f; | ||
} | ||
return 1.0f; | ||
} | ||
|
||
@Override | ||
public int damageDropped(int meta) { | ||
return meta; | ||
} | ||
|
||
@Override | ||
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase entity, ItemStack stack) { | ||
world.setBlockMetadataWithNotify(x, y, z, stack.getItemDamage(), 3); | ||
} | ||
} |
44 changes: 44 additions & 0 deletions
44
src/main/java/com/gtnewhorizons/gtnhintergalactic/block/BlockCasingGasSiphon.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,44 @@ | ||
package com.gtnewhorizons.gtnhintergalactic.block; | ||
|
||
import net.minecraft.block.Block; | ||
import net.minecraft.block.material.Material; | ||
import net.minecraft.world.World; | ||
|
||
import com.gtnewhorizons.gtnhintergalactic.GTNHIntergalactic; | ||
import com.gtnewhorizons.gtnhintergalactic.Tags; | ||
|
||
import gregtech.api.GregTechAPI; | ||
import micdoodle8.mods.galacticraft.api.block.ITerraformableBlock; | ||
|
||
public class BlockCasingGasSiphon extends Block implements ITerraformableBlock { | ||
|
||
public BlockCasingGasSiphon() { | ||
super(Material.rock); | ||
this.setBlockName("GasSiphonCasing"); | ||
this.setHardness(2.0f); | ||
this.setStepSound(soundTypeStone); | ||
this.setHarvestLevel("pickaxe", 3); | ||
this.setCreativeTab(GTNHIntergalactic.tab); | ||
this.setBlockTextureName(Tags.MODID + ":gasSiphon/SiphonCasing"); | ||
GregTechAPI.registerMachineBlock(this, -1); | ||
} | ||
|
||
@Override | ||
public boolean isTerraformable(final World world, final int x, final int y, final int z) { | ||
return false; | ||
} | ||
|
||
@Override | ||
public void onBlockAdded(World world, int x, int y, int z) { | ||
if (GregTechAPI.isMachineBlock(this, world.getBlockMetadata(x, y, z))) { | ||
GregTechAPI.causeMachineUpdate(world, x, y, z); | ||
} | ||
} | ||
|
||
@Override | ||
public void breakBlock(World world, int x, int y, int z, Block block, int meta) { | ||
if (GregTechAPI.isMachineBlock(block, meta)) { | ||
GregTechAPI.causeMachineUpdate(world, x, y, z); | ||
} | ||
} | ||
} |
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
Oops, something went wrong.