Partially done textures per core setup...
This commit is contained in:
parent
52092fdd4f
commit
90ae47bc9c
@ -16,7 +16,8 @@ import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class CoreStabilizer extends ModMachineBlock {
|
||||
protected CoreStabilizer() {
|
||||
byte type;
|
||||
protected CoreStabilizer(byte type) {
|
||||
super(Material.rock);
|
||||
setBlockName("CoreStabilizer");
|
||||
setBlockTextureName(ModInfo.MODID + ":" + getUnlocalizedName().substring(5));
|
||||
@ -24,6 +25,7 @@ public class CoreStabilizer extends ModMachineBlock {
|
||||
setResistance(8);
|
||||
setHardness(8);
|
||||
setHarvestLevel("pickaxe", 2);
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -49,7 +51,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, 1));
|
||||
int[] info = this.wrenched(player, world, x, y, z, false, 0, (byte) 0, new ItemStack(ModBlocks.CoreStabilizer_default, 1));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
@ -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 && world.getBlock(x, y-1, z) == ModBlocks.CoreStabilizer && 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_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) {
|
||||
((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;
|
||||
|
@ -11,7 +11,9 @@ 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 = new CoreStabilizer();
|
||||
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 quaridiumOre = new QuaridiumOre(Material.iron);
|
||||
public static Block blockofashadwithquaridium = new blockOfASHADWithQuaridium(Material.iron);
|
||||
public static Block netherCoreGenerator = new NetherCoreGenerator();
|
||||
@ -21,7 +23,8 @@ public class ModBlocks {
|
||||
ASURegistryHelper.registerBlock(creditsBlock);
|
||||
ASURegistryHelper.registerBlock(ASUPedestal);
|
||||
ASURegistryHelper.registerBlock(EnderCoreGenerator);
|
||||
ASURegistryHelper.registerBlock(CoreStabilizer);
|
||||
ASURegistryHelper.registerBlock(CoreStabilizer_default);
|
||||
ASURegistryHelper.registerBlock(CoreStabilizer_nether);
|
||||
ASURegistryHelper.registerBlock(quaridiumOre);
|
||||
ASURegistryHelper.registerBlock(blockofashadwithquaridium);
|
||||
ASURegistryHelper.registerBlock(netherCoreGenerator);
|
||||
|
@ -78,7 +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 && world.getBlock(x, y-1, z) == ModBlocks.CoreStabilizer && 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_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);
|
||||
((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;
|
||||
@ -88,10 +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.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.markBlockForUpdate(x, y-1, z);
|
||||
}
|
||||
}
|
||||
|
@ -32,9 +32,10 @@ public class ClientProxy extends CommonProxy {
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityEnderCoreGenerator.class, renderEnderCore);
|
||||
MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(ModBlocks.EnderCoreGenerator), new ItemRenderEnderCoreGenerator(renderEnderCore, new TileEntityEnderCoreGenerator()));
|
||||
|
||||
TileEntitySpecialRenderer renderCoreStabilizer = new RenderCoreStabilizer();
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityCoreStabilizer.class, renderCoreStabilizer);
|
||||
MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(ModBlocks.CoreStabilizer), new ItemRenderCoreStabilizer(renderCoreStabilizer, new TileEntityCoreStabilizer()));
|
||||
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 renderNetherCore = new RenderNetherCoreGenerator();
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityNetherCoreGenerator.class, renderNetherCore);
|
||||
|
@ -13,6 +13,8 @@ import net.minecraft.util.ResourceLocation;
|
||||
|
||||
|
||||
public class RenderCoreStabilizer extends TileEntitySpecialRenderer {
|
||||
byte type;
|
||||
|
||||
private ModelCoreStabilizer modelASU = new ModelCoreStabilizer();
|
||||
public static ResourceLocation[] texture = new ResourceLocation[3];
|
||||
public void renderTileEntityAt(TileEntityCoreStabilizer tileentity, double x,
|
||||
@ -26,7 +28,7 @@ public class RenderCoreStabilizer extends TileEntitySpecialRenderer {
|
||||
|
||||
GL11.glTranslatef((float) x + 0.5f, (float) y + 1.5f, (float) z + 0.5f);
|
||||
GL11.glRotatef(180, 0f, 0f, 1f);
|
||||
this.bindTexture(texture[1]);
|
||||
this.bindTexture(texture[type]);
|
||||
|
||||
modelASU.renderModel(0.0625f);
|
||||
|
||||
@ -34,7 +36,7 @@ public class RenderCoreStabilizer extends TileEntitySpecialRenderer {
|
||||
|
||||
}
|
||||
|
||||
public RenderCoreStabilizer() {
|
||||
public RenderCoreStabilizer(byte type) {
|
||||
for (int i = 0; i < texture.length; i++) {
|
||||
texture[i] = new ResourceLocation(ModInfo.MODID + ":" + "/textures/models/CoreStabilizer/ModelCoreStabilizer" + i +".png");
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user