Returned back to normal state and no multiple types of Stabilizers.

This commit is contained in:
Harrison Deng 2015-11-18 09:10:32 -06:00
parent 90ae47bc9c
commit e6fbb4ded7
7 changed files with 22 additions and 22 deletions

View File

@ -16,8 +16,7 @@ import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World; import net.minecraft.world.World;
public class CoreStabilizer extends ModMachineBlock { public class CoreStabilizer extends ModMachineBlock {
byte type; protected CoreStabilizer() {
protected CoreStabilizer(byte type) {
super(Material.rock); super(Material.rock);
setBlockName("CoreStabilizer"); setBlockName("CoreStabilizer");
setBlockTextureName(ModInfo.MODID + ":" + getUnlocalizedName().substring(5)); setBlockTextureName(ModInfo.MODID + ":" + getUnlocalizedName().substring(5));
@ -25,12 +24,11 @@ public class CoreStabilizer extends ModMachineBlock {
setResistance(8); setResistance(8);
setHardness(8); setHardness(8);
setHarvestLevel("pickaxe", 2); setHarvestLevel("pickaxe", 2);
this.type = type;
} }
@Override @Override
public TileEntity createNewTileEntity(World world, int var) { public TileEntity createNewTileEntity(World world, int var) {
return new TileEntityCoreStabilizer(world); return new TileEntityCoreStabilizer();
} }
public int getRenderType() { public int getRenderType() {
@ -51,7 +49,7 @@ public class CoreStabilizer extends ModMachineBlock {
isMultBlock(world, x, y, z); isMultBlock(world, x, y, z);
} }
if (player.getCurrentEquippedItem() != null && player.getCurrentEquippedItem().getItem() == ModItems.wrench) { if (player.getCurrentEquippedItem() != null && player.getCurrentEquippedItem().getItem() == ModItems.wrench) {
int[] info = this.wrenched(player, world, x, y, z, false, 0, (byte) 0, new ItemStack(ModBlocks.CoreStabilizer_default, 1)); int[] info = this.wrenched(player, world, x, y, z, false, 0, (byte) 0, new ItemStack(ModBlocks.CoreStabilizer, 1));
} }
return true; return true;
} }

View File

@ -86,7 +86,7 @@ public class EnderCoreGenerator extends ModMachineBlock {
} }
public void isMultiBlock(World world, int x, int y, int z) { public void isMultiBlock(World world, int x, int y, int z) {
if (world.getBlock(x, y+1, z) == ModBlocks.CoreStabilizer_default && world.getBlock(x, y-1, z) == ModBlocks.CoreStabilizer_default && world.getBlock(x, y-2, z) == ModBlocks.blockofashadwithquaridium && world.getBlock(x, y+2, z) == ModBlocks.blockofashadwithquaridium) { if (world.getBlock(x, y+1, z) == ModBlocks.CoreStabilizer && world.getBlock(x, y-1, z) == ModBlocks.CoreStabilizer && world.getBlock(x, y-2, z) == ModBlocks.blockofashadwithquaridium && world.getBlock(x, y+2, z) == ModBlocks.blockofashadwithquaridium) {
((TileEntityEnderCoreGenerator)world.getTileEntity(x, y, z)).multiblock = true; ((TileEntityEnderCoreGenerator)world.getTileEntity(x, y, z)).multiblock = true;
((TileEntityCoreStabilizer)world.getTileEntity(x, y+1, z)).multiblock = true; ((TileEntityCoreStabilizer)world.getTileEntity(x, y+1, z)).multiblock = true;
((TileEntityCoreStabilizer)world.getTileEntity(x, y-1, z)).multiblock = true; ((TileEntityCoreStabilizer)world.getTileEntity(x, y-1, z)).multiblock = true;

View File

@ -11,9 +11,7 @@ public class ModBlocks {
public static Block creditsBlock = new Blocker(); public static Block creditsBlock = new Blocker();
public static Block ASUPedestal = new ASUPedestal(); public static Block ASUPedestal = new ASUPedestal();
public static Block EnderCoreGenerator = new EnderCoreGenerator(); public static Block EnderCoreGenerator = new EnderCoreGenerator();
public static Block CoreStabilizer_default = new CoreStabilizer((byte) 0); public static Block CoreStabilizer = new CoreStabilizer();
public static Block CoreStabilizer_nether = new CoreStabilizer((byte) 1);
public static Block CoreStabilizer_ender = new CoreStabilizer((byte) 2);
public static Block quaridiumOre = new QuaridiumOre(Material.iron); public static Block quaridiumOre = new QuaridiumOre(Material.iron);
public static Block blockofashadwithquaridium = new blockOfASHADWithQuaridium(Material.iron); public static Block blockofashadwithquaridium = new blockOfASHADWithQuaridium(Material.iron);
public static Block netherCoreGenerator = new NetherCoreGenerator(); public static Block netherCoreGenerator = new NetherCoreGenerator();
@ -23,8 +21,7 @@ public class ModBlocks {
ASURegistryHelper.registerBlock(creditsBlock); ASURegistryHelper.registerBlock(creditsBlock);
ASURegistryHelper.registerBlock(ASUPedestal); ASURegistryHelper.registerBlock(ASUPedestal);
ASURegistryHelper.registerBlock(EnderCoreGenerator); ASURegistryHelper.registerBlock(EnderCoreGenerator);
ASURegistryHelper.registerBlock(CoreStabilizer_default); ASURegistryHelper.registerBlock(CoreStabilizer);
ASURegistryHelper.registerBlock(CoreStabilizer_nether);
ASURegistryHelper.registerBlock(quaridiumOre); ASURegistryHelper.registerBlock(quaridiumOre);
ASURegistryHelper.registerBlock(blockofashadwithquaridium); ASURegistryHelper.registerBlock(blockofashadwithquaridium);
ASURegistryHelper.registerBlock(netherCoreGenerator); ASURegistryHelper.registerBlock(netherCoreGenerator);

View File

@ -78,9 +78,9 @@ public class NetherCoreGenerator extends ModMachineBlock {
} }
public void isMultiBlock(World world, int x, int y, int z) { public void isMultiBlock(World world, int x, int y, int z) {
if (world.getBlock(x, y+1, z) == ModBlocks.CoreStabilizer_default && world.getBlock(x, y-1, z) == ModBlocks.CoreStabilizer_default && world.getBlock(x, y-2, z) == ModBlocks.blockofashadwithquaridium && world.getBlock(x, y+2, z) == ModBlocks.blockofashadwithquaridium) { if (world.getBlock(x, y+1, z) == ModBlocks.CoreStabilizer && world.getBlock(x, y-1, z) == ModBlocks.CoreStabilizer && world.getBlock(x, y-2, z) == ModBlocks.blockofashadwithquaridium && world.getBlock(x, y+2, z) == ModBlocks.blockofashadwithquaridium) {
world.setBlock(x, y+1, z, ModBlocks.CoreStabilizer_nether); world.setBlock(x, y+1, z, ModBlocks.CoreStabilizer);
world.setBlock(x, y-1, z, ModBlocks.CoreStabilizer_nether); world.setBlock(x, y-1, z, ModBlocks.CoreStabilizer);
((TileEntityNetherCoreGenerator)world.getTileEntity(x, y, z)).multiblock = true; ((TileEntityNetherCoreGenerator)world.getTileEntity(x, y, z)).multiblock = true;
((TileEntityCoreStabilizer)world.getTileEntity(x, y+1, z)).multiblock = true; ((TileEntityCoreStabilizer)world.getTileEntity(x, y+1, z)).multiblock = true;
((TileEntityCoreStabilizer)world.getTileEntity(x, y-1, z)).multiblock = true; ((TileEntityCoreStabilizer)world.getTileEntity(x, y-1, z)).multiblock = true;
@ -90,12 +90,12 @@ public class NetherCoreGenerator extends ModMachineBlock {
((TileEntityNetherCoreGenerator)world.getTileEntity(x, y, z)).multiblock = false; ((TileEntityNetherCoreGenerator)world.getTileEntity(x, y, z)).multiblock = false;
if (world.getTileEntity(x, y+1, z) instanceof TileEntityCoreStabilizer) { if (world.getTileEntity(x, y+1, z) instanceof TileEntityCoreStabilizer) {
((TileEntityCoreStabilizer)world.getTileEntity(x, y+1, z)).multiblock = false; ((TileEntityCoreStabilizer)world.getTileEntity(x, y+1, z)).multiblock = false;
world.setBlock(x, y+1, z, ModBlocks.CoreStabilizer_default); world.setBlock(x, y+1, z, ModBlocks.CoreStabilizer);
world.markBlockForUpdate(x, y+1, z); world.markBlockForUpdate(x, y+1, z);
} }
if (world.getTileEntity(x, y-1, z) instanceof TileEntityCoreStabilizer) { if (world.getTileEntity(x, y-1, z) instanceof TileEntityCoreStabilizer) {
((TileEntityCoreStabilizer)world.getTileEntity(x, y-1, z)).multiblock = false; ((TileEntityCoreStabilizer)world.getTileEntity(x, y-1, z)).multiblock = false;
world.setBlock(x, y, z, ModBlocks.CoreStabilizer_default); world.setBlock(x, y, z, ModBlocks.CoreStabilizer);
world.markBlockForUpdate(x, y-1, z); world.markBlockForUpdate(x, y-1, z);
} }
} }

View File

@ -8,8 +8,10 @@ import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World; import net.minecraft.world.World;
public class TileEntityCoreStabilizer extends TileEntity { public class TileEntityCoreStabilizer extends TileEntity {
byte type;
public TileEntityCoreStabilizer(World world) { public TileEntityCoreStabilizer (byte type) {
this.type = type;
} }
public TileEntityCoreStabilizer() { public TileEntityCoreStabilizer() {
@ -62,4 +64,8 @@ public class TileEntityCoreStabilizer extends TileEntity {
readFromNBT(pkt.func_148857_g()); readFromNBT(pkt.func_148857_g());
worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
} }
public byte getType() {
return type;
}
} }

View File

@ -32,10 +32,9 @@ public class ClientProxy extends CommonProxy {
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityEnderCoreGenerator.class, renderEnderCore); ClientRegistry.bindTileEntitySpecialRenderer(TileEntityEnderCoreGenerator.class, renderEnderCore);
MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(ModBlocks.EnderCoreGenerator), new ItemRenderEnderCoreGenerator(renderEnderCore, new TileEntityEnderCoreGenerator())); MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(ModBlocks.EnderCoreGenerator), new ItemRenderEnderCoreGenerator(renderEnderCore, new TileEntityEnderCoreGenerator()));
TileEntitySpecialRenderer renderCoreStabilizer_default = new RenderCoreStabilizer((byte) 0); TileEntitySpecialRenderer renderCoreStabilizer = new RenderCoreStabilizer();
TileEntitySpecialRenderer renderCoreStabilizer_nether = new RenderCoreStabilizer((byte) 2); ClientRegistry.bindTileEntitySpecialRenderer(TileEntityCoreStabilizer.class, renderCoreStabilizer);
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityCoreStabilizer.class, renderCoreStabilizer_default); MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(ModBlocks.CoreStabilizer), new ItemRenderCoreStabilizer(renderCoreStabilizer, new TileEntityCoreStabilizer()));
MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(ModBlocks.CoreStabilizer_default), new ItemRenderCoreStabilizer(renderCoreStabilizer_default, new TileEntityCoreStabilizer()));
TileEntitySpecialRenderer renderNetherCore = new RenderNetherCoreGenerator(); TileEntitySpecialRenderer renderNetherCore = new RenderNetherCoreGenerator();
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityNetherCoreGenerator.class, renderNetherCore); ClientRegistry.bindTileEntitySpecialRenderer(TileEntityNetherCoreGenerator.class, renderNetherCore);

View File

@ -36,7 +36,7 @@ public class RenderCoreStabilizer extends TileEntitySpecialRenderer {
} }
public RenderCoreStabilizer(byte type) { public RenderCoreStabilizer() {
for (int i = 0; i < texture.length; i++) { for (int i = 0; i < texture.length; i++) {
texture[i] = new ResourceLocation(ModInfo.MODID + ":" + "/textures/models/CoreStabilizer/ModelCoreStabilizer" + i +".png"); texture[i] = new ResourceLocation(ModInfo.MODID + ":" + "/textures/models/CoreStabilizer/ModelCoreStabilizer" + i +".png");
} }