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;
public class CoreStabilizer extends ModMachineBlock {
byte type;
protected CoreStabilizer(byte type) {
protected CoreStabilizer() {
super(Material.rock);
setBlockName("CoreStabilizer");
setBlockTextureName(ModInfo.MODID + ":" + getUnlocalizedName().substring(5));
@ -25,12 +24,11 @@ public class CoreStabilizer extends ModMachineBlock {
setResistance(8);
setHardness(8);
setHarvestLevel("pickaxe", 2);
this.type = type;
}
@Override
public TileEntity createNewTileEntity(World world, int var) {
return new TileEntityCoreStabilizer(world);
return new TileEntityCoreStabilizer();
}
public int getRenderType() {
@ -51,7 +49,7 @@ public class CoreStabilizer extends ModMachineBlock {
isMultBlock(world, x, y, z);
}
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;
}

View File

@ -86,7 +86,7 @@ public class EnderCoreGenerator extends ModMachineBlock {
}
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;
((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 ASUPedestal = new ASUPedestal();
public static Block EnderCoreGenerator = new EnderCoreGenerator();
public static Block CoreStabilizer_default = new CoreStabilizer((byte) 0);
public static Block CoreStabilizer_nether = new CoreStabilizer((byte) 1);
public static Block CoreStabilizer_ender = new CoreStabilizer((byte) 2);
public static Block CoreStabilizer = new CoreStabilizer();
public static Block quaridiumOre = new QuaridiumOre(Material.iron);
public static Block blockofashadwithquaridium = new blockOfASHADWithQuaridium(Material.iron);
public static Block netherCoreGenerator = new NetherCoreGenerator();
@ -23,8 +21,7 @@ public class ModBlocks {
ASURegistryHelper.registerBlock(creditsBlock);
ASURegistryHelper.registerBlock(ASUPedestal);
ASURegistryHelper.registerBlock(EnderCoreGenerator);
ASURegistryHelper.registerBlock(CoreStabilizer_default);
ASURegistryHelper.registerBlock(CoreStabilizer_nether);
ASURegistryHelper.registerBlock(CoreStabilizer);
ASURegistryHelper.registerBlock(quaridiumOre);
ASURegistryHelper.registerBlock(blockofashadwithquaridium);
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) {
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) {
world.setBlock(x, y+1, z, ModBlocks.CoreStabilizer_nether);
world.setBlock(x, y-1, z, ModBlocks.CoreStabilizer_nether);
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);
world.setBlock(x, y-1, z, ModBlocks.CoreStabilizer);
((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;
@ -90,12 +90,12 @@ public class NetherCoreGenerator extends ModMachineBlock {
((TileEntityNetherCoreGenerator)world.getTileEntity(x, y, z)).multiblock = false;
if (world.getTileEntity(x, y+1, z) instanceof TileEntityCoreStabilizer) {
((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);
}
if (world.getTileEntity(x, y-1, z) instanceof TileEntityCoreStabilizer) {
((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);
}
}

View File

@ -8,8 +8,10 @@ import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
public class TileEntityCoreStabilizer extends TileEntity {
byte type;
public TileEntityCoreStabilizer(World world) {
public TileEntityCoreStabilizer (byte type) {
this.type = type;
}
public TileEntityCoreStabilizer() {
@ -62,4 +64,8 @@ public class TileEntityCoreStabilizer extends TileEntity {
readFromNBT(pkt.func_148857_g());
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);
MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(ModBlocks.EnderCoreGenerator), new ItemRenderEnderCoreGenerator(renderEnderCore, new TileEntityEnderCoreGenerator()));
TileEntitySpecialRenderer renderCoreStabilizer_default = new RenderCoreStabilizer((byte) 0);
TileEntitySpecialRenderer renderCoreStabilizer_nether = new RenderCoreStabilizer((byte) 2);
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityCoreStabilizer.class, renderCoreStabilizer_default);
MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(ModBlocks.CoreStabilizer_default), new ItemRenderCoreStabilizer(renderCoreStabilizer_default, new TileEntityCoreStabilizer()));
TileEntitySpecialRenderer renderCoreStabilizer = new RenderCoreStabilizer();
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityCoreStabilizer.class, renderCoreStabilizer);
MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(ModBlocks.CoreStabilizer), new ItemRenderCoreStabilizer(renderCoreStabilizer, new TileEntityCoreStabilizer()));
TileEntitySpecialRenderer renderNetherCore = new RenderNetherCoreGenerator();
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++) {
texture[i] = new ResourceLocation(ModInfo.MODID + ":" + "/textures/models/CoreStabilizer/ModelCoreStabilizer" + i +".png");
}