mirror of
https://github.com/GTNewHorizons/Gadomancy.git
synced 2026-11-25 22:34:28 +00:00
Added randomization focus
This commit is contained in:
1 parent
3241ac6b5c
commit
4379b02592
13 files changed
+262
-100
No files matched your search
@@ -11,10 +11,7 @@ import makeo.gadomancy.client.renderers.block.BlockExtendedNodeJarRenderer;
|
||||
import makeo.gadomancy.client.renderers.block.BlockNodeManipulatorRenderer;
|
||||
import makeo.gadomancy.client.renderers.block.RenderBlockTransparent;
|
||||
import makeo.gadomancy.client.renderers.entity.RenderAdditionalGolemBase;
|
||||
import makeo.gadomancy.client.renderers.item.ItemExNodeRenderer;
|
||||
import makeo.gadomancy.client.renderers.item.ItemJarExtendedNodeRenderer;
|
||||
import makeo.gadomancy.client.renderers.item.ItemRenderRemoteJar;
|
||||
import makeo.gadomancy.client.renderers.item.ItemRenderTileEntity;
|
||||
import makeo.gadomancy.client.renderers.item.*;
|
||||
import makeo.gadomancy.client.renderers.tile.*;
|
||||
import makeo.gadomancy.common.CommonProxy;
|
||||
import makeo.gadomancy.common.blocks.tiles.*;
|
||||
@@ -79,7 +76,10 @@ public class ClientProxy extends CommonProxy {
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileExtendedNodeJar.class, nodeJarRenderer);
|
||||
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileNodeManipulator.class, new RenderTileNodeManipulator());
|
||||
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileManipulatorPillar.class, new RenderTileManipulatorPillar());
|
||||
RenderTileManipulationFocus renderTileManipulationFocus = new RenderTileManipulationFocus();
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileManipulationFocus.class, renderTileManipulationFocus);
|
||||
|
||||
//Items
|
||||
TileArcaneDropper fakeTile = new TileArcaneDropper();
|
||||
@@ -93,6 +93,10 @@ public class ClientProxy extends CommonProxy {
|
||||
MinecraftForgeClient.registerItemRenderer(RegisteredItems.itemExtendedNodeJar, new ItemJarExtendedNodeRenderer());
|
||||
MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(RegisteredBlocks.blockRemoteJar), new ItemRenderRemoteJar(renderTileRemoteJar));
|
||||
|
||||
ItemRenderStoneMachine itemRenderStoneMachine = new ItemRenderStoneMachine();
|
||||
MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(RegisteredBlocks.blockStoneMachine), itemRenderStoneMachine);
|
||||
itemRenderStoneMachine.registerRenderer(0, new TileManipulationFocus(), renderTileManipulationFocus);
|
||||
|
||||
//Blocks
|
||||
RegisteredBlocks.rendererTransparentBlock = registerBlockRenderer(new RenderBlockTransparent());
|
||||
RegisteredBlocks.rendererExtendedNodeJarBlock = registerBlockRenderer(new BlockExtendedNodeJarRenderer());
|
||||
|
||||
@@ -0,0 +1,70 @@
|
||||
package makeo.gadomancy.client.models;
|
||||
|
||||
import net.minecraft.client.model.ModelBase;
|
||||
import net.minecraft.client.model.ModelRenderer;
|
||||
import net.minecraft.entity.Entity;
|
||||
|
||||
/**
|
||||
* This class is part of the Gadomancy Mod
|
||||
* Gadomancy is Open Source and distributed under the
|
||||
* GNU LESSER GENERAL PUBLIC LICENSE
|
||||
* for more read the LICENSE file
|
||||
* <p/>
|
||||
* Created by makeo @ 28.10.2015 12:31
|
||||
*/
|
||||
public class ModelManipulatorPart extends ModelBase {
|
||||
//fields
|
||||
ModelRenderer shape2;
|
||||
ModelRenderer shape3;
|
||||
ModelRenderer shape4;
|
||||
ModelRenderer shape5;
|
||||
|
||||
public ModelManipulatorPart() {
|
||||
textureWidth = 8;
|
||||
textureHeight = 16;
|
||||
|
||||
shape2 = new ModelRenderer(this, 0, 5);
|
||||
shape2.addBox(-1F, -2F, 0.41F, 2, 2, 1);
|
||||
shape2.setRotationPoint(0F, 22F, 4F);
|
||||
shape2.setTextureSize(8, 16);
|
||||
shape2.mirror = true;
|
||||
setRotation(shape2, 0F, 0F, 0F);
|
||||
shape3 = new ModelRenderer(this, 0, 8);
|
||||
shape3.addBox(-1F, -3.4F, 1F, 2, 2, 1);
|
||||
shape3.setRotationPoint(0F, 22F, 4F);
|
||||
shape3.setTextureSize(8, 16);
|
||||
shape3.mirror = true;
|
||||
setRotation(shape3, 0.3490659F, 0F, 0F);
|
||||
shape4 = new ModelRenderer(this, 0, 0);
|
||||
shape4.addBox(-1F, -1F, 0F, 2, 4, 1);
|
||||
shape4.setRotationPoint(0F, 22F, 4F);
|
||||
shape4.setTextureSize(8, 16);
|
||||
shape4.mirror = true;
|
||||
setRotation(shape4, -0.7853982F, 0F, 0F);
|
||||
shape5 = new ModelRenderer(this, 0, 11);
|
||||
shape5.addBox(-1F, -4.25F, 2.24F, 2, 2, 1);
|
||||
shape5.setRotationPoint(0F, 22F, 4F);
|
||||
shape5.setTextureSize(8, 16);
|
||||
shape5.mirror = true;
|
||||
setRotation(shape5, 0.7853982F, 0F, 0F);
|
||||
}
|
||||
|
||||
public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) {
|
||||
super.render(entity, f, f1, f2, f3, f4, f5);
|
||||
setRotationAngles(f, f1, f2, f3, f4, f5, entity);
|
||||
shape2.render(f5);
|
||||
shape3.render(f5);
|
||||
shape4.render(f5);
|
||||
shape5.render(f5);
|
||||
}
|
||||
|
||||
private void setRotation(ModelRenderer model, float x, float y, float z) {
|
||||
model.rotateAngleX = x;
|
||||
model.rotateAngleY = y;
|
||||
model.rotateAngleZ = z;
|
||||
}
|
||||
|
||||
public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity entity) {
|
||||
super.setRotationAngles(f, f1, f2, f3, f4, f5, entity);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
package makeo.gadomancy.client.renderers.item;
|
||||
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* This class is part of the Gadomancy Mod
|
||||
* Gadomancy is Open Source and distributed under the
|
||||
* GNU LESSER GENERAL PUBLIC LICENSE
|
||||
* for more read the LICENSE file
|
||||
* <p/>
|
||||
* Created by makeo @ 28.10.2015 23:27
|
||||
*/
|
||||
public class ItemRenderStoneMachine extends ItemRenderTileEntity<TileEntity> {
|
||||
private final Map<Integer, RenderInfo> renderers = new HashMap<Integer, RenderInfo>();
|
||||
|
||||
public ItemRenderStoneMachine() { }
|
||||
|
||||
private static class RenderInfo {
|
||||
private TileEntity tile;
|
||||
private TileEntitySpecialRenderer renderer;
|
||||
}
|
||||
|
||||
public void registerRenderer(int metadata, TileEntity tile, TileEntitySpecialRenderer renderer) {
|
||||
RenderInfo info = new RenderInfo();
|
||||
info.renderer = renderer;
|
||||
info.tile = tile;
|
||||
renderers.put(metadata, info);
|
||||
|
||||
if(tile.getWorldObj() == null) {
|
||||
tile.setWorldObj(FAKE_WORLD);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderItem(ItemRenderType type, ItemStack stack, Object... data) {
|
||||
RenderInfo info = renderers.get(stack.getItemDamage());
|
||||
|
||||
tile = info.tile;
|
||||
renderer = info.renderer;
|
||||
|
||||
if(stack.getItemDamage() == 0) {
|
||||
GL11.glTranslatef(0, 2/16f, 0);
|
||||
}
|
||||
|
||||
super.renderItem(type, stack, data);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean handleRenderType(ItemStack stack, ItemRenderType type) {
|
||||
return renderers.containsKey(stack.getItemDamage());
|
||||
}
|
||||
}
|
||||
@@ -17,13 +17,13 @@ import org.lwjgl.opengl.GL11;
|
||||
* Created by makeo @ 29.09.2015 18:29
|
||||
*/
|
||||
public class ItemRenderTileEntity<T extends TileEntity> implements IItemRenderer {
|
||||
private static final World FAKE_WORLD = new FakeWorld();
|
||||
protected static final World FAKE_WORLD = new FakeWorld();
|
||||
|
||||
private final TileEntitySpecialRenderer render;
|
||||
protected final T tile;
|
||||
protected TileEntitySpecialRenderer renderer;
|
||||
protected T tile;
|
||||
|
||||
public ItemRenderTileEntity(TileEntitySpecialRenderer render, T tile) {
|
||||
this.render = render;
|
||||
public ItemRenderTileEntity(TileEntitySpecialRenderer renderer, T tile) {
|
||||
this.renderer = renderer;
|
||||
this.tile = tile;
|
||||
|
||||
if(tile.getWorldObj() == null) {
|
||||
@@ -31,6 +31,8 @@ public class ItemRenderTileEntity<T extends TileEntity> implements IItemRenderer
|
||||
}
|
||||
}
|
||||
|
||||
protected ItemRenderTileEntity() { }
|
||||
|
||||
@Override
|
||||
public boolean handleRenderType(ItemStack item, ItemRenderType type) {
|
||||
return true;
|
||||
@@ -50,6 +52,6 @@ public class ItemRenderTileEntity<T extends TileEntity> implements IItemRenderer
|
||||
GL11.glTranslatef(0, -0.1f, 0);
|
||||
}
|
||||
|
||||
this.render.renderTileEntityAt(tile, 0.0D, 0.0D, 0.0D, 0.0F);
|
||||
this.renderer.renderTileEntityAt(tile, 0.0D, 0.0D, 0.0D, 0.0F);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
package makeo.gadomancy.client.renderers.tile;
|
||||
|
||||
import makeo.gadomancy.client.models.ModelManipulatorPart;
|
||||
import makeo.gadomancy.common.blocks.tiles.TileManipulationFocus;
|
||||
import makeo.gadomancy.common.utils.SimpleResourceLocation;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
/**
|
||||
* This class is part of the Gadomancy Mod
|
||||
* Gadomancy is Open Source and distributed under the
|
||||
* GNU LESSER GENERAL PUBLIC LICENSE
|
||||
* for more read the LICENSE file
|
||||
* <p/>
|
||||
* Created by makeo @ 28.10.2015 18:00
|
||||
*/
|
||||
public class RenderTileManipulationFocus extends TileEntitySpecialRenderer {
|
||||
private static final ModelManipulatorPart RANDOM_FOCUS = new ModelManipulatorPart();
|
||||
|
||||
public void renderTileEntityAt(TileManipulationFocus tile, double x, double y, double z, float partialTicks) {
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(x, y, z);
|
||||
|
||||
bindTexture(new SimpleResourceLocation("models/manipulation_focus_" + tile.fociId + ".png"));
|
||||
|
||||
GL11.glRotatef(180, 1, 0, 0);
|
||||
GL11.glTranslatef(0.5f, -1.5f + (2/16f), -0.5f);
|
||||
|
||||
if(tile.fociId == 0) {
|
||||
GL11.glPushMatrix();
|
||||
for(int i = 0; i < 4; i++) {
|
||||
RANDOM_FOCUS.render(null, 0, 0, 0, 0, 0, 0.0625f);
|
||||
GL11.glRotatef(90, 0, 1, 0);
|
||||
}
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderTileEntityAt(TileEntity tile, double x, double y, double z, float partialTicks) {
|
||||
renderTileEntityAt((TileManipulationFocus)tile, x, y, z, partialTicks);
|
||||
}
|
||||
}
|
||||
@@ -28,26 +28,6 @@ public class RenderTileNodeManipulator extends TileWandPedestalRenderer {
|
||||
@Override
|
||||
public void renderTileEntityAt(TileEntity tile, double x, double y, double z, float partitalTicks) {
|
||||
super.renderTileEntityAt(tile, x, y, z, partitalTicks);
|
||||
|
||||
GL11.glPushMatrix();
|
||||
|
||||
GL11.glTranslated(x, y, z);
|
||||
GL11.glTranslatef(0.5f, 1.5f, 0.5f);
|
||||
|
||||
//Why don't you clean up Azanor -_-"
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
int brightness = Minecraft.getMinecraft().thePlayer.getBrightnessForRender(0.0F);
|
||||
int k = brightness % 65536;
|
||||
int l = brightness / 65536;
|
||||
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, k / 1.0F, l / 1.0F);
|
||||
|
||||
bindTexture(TextureMap.locationBlocksTexture);
|
||||
BlockNodeManipulatorRenderer.renderWandPedestalFocus(RegisteredBlocks.blockNodeManipulator, RenderBlocks.getInstance());
|
||||
|
||||
//TODO: add color
|
||||
renderColorCubes(1, 0.5f, 0, 1);
|
||||
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
public static void renderColorCubes(float r, float g, float b, float a) {
|
||||
|
||||
@@ -76,73 +76,21 @@ public class BlockNodeManipulator extends BlockStoneDevice {
|
||||
par3List.add(new ItemStack(par1, 1, 5));
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canPlaceBlockAt(World world, int x, int y, int z) {
|
||||
return world.getBlock(x, y + 1, z) == Blocks.air && super.canPlaceBlockAt(world, x, y, z);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNeighborBlockChange(World world, int x, int y, int z, Block par5) {
|
||||
if(world.getBlock(x, y + 1, z) != Blocks.air) {
|
||||
TileEntity te = world.getTileEntity(x, y, z);
|
||||
if(te != null && te instanceof TileNodeManipulator) {
|
||||
if(((TileNodeManipulator) te).isInMultiblock())
|
||||
((TileNodeManipulator) te).breakMultiblock();
|
||||
}
|
||||
dropBlockAsItem(world, x, y, z, 5, 0);
|
||||
world.setBlockToAir(x, y, z);
|
||||
}
|
||||
super.onNeighborBlockChange(world, x, y, z, par5);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float par7, float par8, float par9) {
|
||||
if(world.isRemote) return true;
|
||||
|
||||
TileEntity te = world.getTileEntity(x, y, z);
|
||||
if (te != null && te instanceof TileNodeManipulator) {
|
||||
TileNodeManipulator manipulator = (TileNodeManipulator) te;
|
||||
if(player.getCurrentEquippedItem() != null && player.getCurrentEquippedItem().getItem() instanceof ItemWandCasting) {
|
||||
manipulator.checkMultiblock();
|
||||
if (manipulator.isMultiblockStructurePresent()) {
|
||||
if (manipulator.isInMultiblock()) {
|
||||
return tryAddWandOrRemove(manipulator, x, y, z, player);
|
||||
} else if (ThaumcraftApiHelper.consumeVisFromWandCrafting(player.getCurrentEquippedItem(), player, RegisteredRecipes.costsNodeManipulatorMultiblock, true)) {
|
||||
manipulator.formMultiblock();
|
||||
return true;
|
||||
}
|
||||
TileNodeManipulator tile = (TileNodeManipulator) world.getTileEntity(x, y, z);
|
||||
ItemStack heldItem = player.getHeldItem();
|
||||
if(tile.isInMultiblock()) {
|
||||
super.onBlockActivated(world, x, y, z, player, side, par7, par8, par9);
|
||||
} else if(!world.isRemote && heldItem != null && heldItem.getItem() instanceof ItemWandCasting) {
|
||||
tile.checkMultiblock();
|
||||
if (tile.isMultiblockStructurePresent()) {
|
||||
if (ThaumcraftApiHelper.consumeVisFromWandCrafting(player.getCurrentEquippedItem(), player, RegisteredRecipes.costsNodeManipulatorMultiblock, true)) {
|
||||
tile.formMultiblock();
|
||||
return true;
|
||||
}
|
||||
} else {
|
||||
tryAddWandOrRemove(manipulator, x, y, z, player);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
private boolean tryAddWandOrRemove(TileNodeManipulator manipulator, int x, int y, int z, EntityPlayer player) {
|
||||
World world = manipulator.getWorldObj();
|
||||
if (manipulator.getStackInSlot(0) != null) {
|
||||
InventoryUtils.dropItemsAtEntity(world, x, y, z, player);
|
||||
world.markBlockForUpdate(x, y, z);
|
||||
manipulator.markDirty();
|
||||
world.playSoundEffect(x, y, z, "random.pop", 0.2F, ((world.rand.nextFloat() - world.rand.nextFloat()) * 0.7F + 1.0F) * 1.5F);
|
||||
return true;
|
||||
}
|
||||
if (player.getCurrentEquippedItem() != null && player.getCurrentEquippedItem().getItem() instanceof ItemWandCasting) {
|
||||
ItemStack i = player.getCurrentEquippedItem().copy();
|
||||
i.stackSize = 1;
|
||||
manipulator.setInventorySlotContents(0, i);
|
||||
player.getCurrentEquippedItem().stackSize -= 1;
|
||||
if (player.getCurrentEquippedItem().stackSize == 0) {
|
||||
player.setCurrentItemOrArmor(0, null);
|
||||
}
|
||||
player.inventory.markDirty();
|
||||
world.markBlockForUpdate(x, y, z);
|
||||
manipulator.markDirty();
|
||||
world.playSoundEffect(x, y, z, "random.pop", 0.2F, ((world.rand.nextFloat() - world.rand.nextFloat()) * 0.7F + 1.0F) * 1.6F);
|
||||
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
package makeo.gadomancy.common.blocks;
|
||||
|
||||
import makeo.gadomancy.common.blocks.tiles.TileManipulationFocus;
|
||||
import makeo.gadomancy.common.blocks.tiles.TileManipulatorPillar;
|
||||
import makeo.gadomancy.common.registration.RegisteredBlocks;
|
||||
import makeo.gadomancy.common.registration.RegisteredItems;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
@@ -40,16 +42,20 @@ public class BlockStoneMachine extends Block {
|
||||
}
|
||||
|
||||
private IIcon pillarIcon;
|
||||
private IIcon focusIcon;
|
||||
|
||||
@Override
|
||||
public void registerBlockIcons(IIconRegister ir) {
|
||||
pillarIcon = ir.registerIcon("thaumcraft:es_1");
|
||||
focusIcon = ir.registerIcon("thaumcraft:thaumiumblock");
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getIcon(int side, int metadata) {
|
||||
if(metadata == 11 || metadata == 15) {
|
||||
return pillarIcon;
|
||||
} else if(metadata == 0) {
|
||||
return focusIcon;
|
||||
}
|
||||
|
||||
return super.getIcon(side, metadata);
|
||||
@@ -57,11 +63,12 @@ public class BlockStoneMachine extends Block {
|
||||
|
||||
@Override
|
||||
public boolean hasTileEntity(int metadata) {
|
||||
return metadata == 15;
|
||||
return metadata == 15 || metadata == 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubBlocks(Item item, CreativeTabs tab, List list) {
|
||||
list.add(new ItemStack(item, 1, 0));
|
||||
list.add(new ItemStack(item, 1, 15));
|
||||
list.add(new ItemStack(item, 1, 11));
|
||||
}
|
||||
@@ -80,10 +87,17 @@ public class BlockStoneMachine extends Block {
|
||||
public TileEntity createTileEntity(World world, int metadata) {
|
||||
if(metadata == 15) {
|
||||
return new TileManipulatorPillar();
|
||||
} else if(metadata == 0) {
|
||||
return new TileManipulationFocus();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int damageDropped(int metadata) {
|
||||
return metadata;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getItemDropped(int metadata, Random random, int fortune) {
|
||||
if(metadata == 11 || metadata == 15) {
|
||||
@@ -94,8 +108,11 @@ public class BlockStoneMachine extends Block {
|
||||
}
|
||||
|
||||
@Override
|
||||
public int damageDropped(int metadata) {
|
||||
return metadata == 0 ? 15 : metadata == 1 ? 11 : metadata;
|
||||
public boolean canReplace(World world, int x, int y, int z, int side, ItemStack stack) {
|
||||
if(stack.getItemDamage() == 0 && (y < 1 || world.getBlock(x, y - 1, z) != RegisteredBlocks.blockNodeManipulator)) {
|
||||
return false;
|
||||
}
|
||||
return super.canReplace(world, x, y, z, side, stack);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -111,6 +128,11 @@ public class BlockStoneMachine extends Block {
|
||||
dropBlockAsItem(world, x, y, z, metadata, 0);
|
||||
world.setBlockToAir(x, y, z);
|
||||
}
|
||||
} else if(metadata == 0) {
|
||||
if(world.getBlock(x, y - 1, z) != RegisteredBlocks.blockNodeManipulator || world.getBlockMetadata(x, y - 1, z) != 5) {
|
||||
dropBlockAsItem(world, x, y, z, metadata, 0);
|
||||
world.setBlockToAir(x, y, z);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -121,6 +143,8 @@ public class BlockStoneMachine extends Block {
|
||||
setBlockBounds(0, 0, 0, 1, 0.5f, 1);
|
||||
} else if(metadata == 11) {
|
||||
setBlockBounds(0.0F, -1.0F, 0.0F, 1.0F, -0.5F, 1.0F);
|
||||
} else if(metadata == 0) {
|
||||
setBlockBounds(3/16f, 0, 3/16f, 1-(3/16f), 6/16f, 1-(3/16f));
|
||||
}
|
||||
super.setBlockBoundsBasedOnState(world, x, y, z);
|
||||
}
|
||||
@@ -129,7 +153,7 @@ public class BlockStoneMachine extends Block {
|
||||
public void addCollisionBoxesToList(World world, int x, int y, int z, AxisAlignedBB axisalignedbb, List list, Entity entity) {
|
||||
int metadata = world.getBlockMetadata(x, y, z);
|
||||
if(metadata == 11 || metadata == 15) {
|
||||
setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
|
||||
setBlockBounds(0, 0, 0, 1, 1, 1);
|
||||
}
|
||||
|
||||
super.addCollisionBoxesToList(world, x, y, z, axisalignedbb, list, entity);
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
package makeo.gadomancy.common.blocks.tiles;
|
||||
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
/**
|
||||
* This class is part of the Gadomancy Mod
|
||||
* Gadomancy is Open Source and distributed under the
|
||||
* GNU LESSER GENERAL PUBLIC LICENSE
|
||||
* for more read the LICENSE file
|
||||
* <p/>
|
||||
* Created by makeo @ 28.10.2015 16:27
|
||||
*/
|
||||
public class TileManipulationFocus extends SynchronizedTileEntity {
|
||||
public int fociId;
|
||||
|
||||
@Override
|
||||
public boolean canUpdate() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readCustomNBT(NBTTagCompound compound) {
|
||||
fociId = compound.getInteger("fociId");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeCustomNBT(NBTTagCompound compound) {
|
||||
compound.setInteger("fociId", fociId);
|
||||
}
|
||||
}
|
||||
@@ -96,6 +96,7 @@ public class RegisteredBlocks {
|
||||
registerTile(TileExtendedNodeJar.class);
|
||||
registerTile(TileNodeManipulator.class);
|
||||
registerTile(TileManipulatorPillar.class);
|
||||
registerTile(TileManipulationFocus.class);
|
||||
}
|
||||
|
||||
private static void registerTile(Class<? extends TileEntity> tile, String name) {
|
||||
|
||||
@@ -13,15 +13,13 @@ import thaumcraft.common.config.ConfigBlocks;
|
||||
* Created by HellFirePvP @ 27.10.2015 14:05
|
||||
*/
|
||||
public class RegisteredMultiblocks {
|
||||
|
||||
public static final MultiblockHelper.MultiblockPattern incompleteNodeManipulatorMultiblock = new MultiblockHelper.MultiblockPattern(RegisteredBlocks.blockNodeManipulator, 5)
|
||||
.addBlock(0, 2, 0, RegisteredBlocks.blockNode, 0).addBlock(0, 1, 0, Blocks.air, 0)
|
||||
.addBlock(0, 2, 0, RegisteredBlocks.blockNode, 0).addBlock(0, 1, 0, RegisteredBlocks.blockStoneMachine, 0)
|
||||
.addBlock(1, 0, 1, ConfigBlocks.blockCosmeticSolid, 15).addBlock(-1, 0, 1, ConfigBlocks.blockCosmeticSolid, 15).addBlock(-1, 0, -1, ConfigBlocks.blockCosmeticSolid, 15).addBlock(1, 0, -1, ConfigBlocks.blockCosmeticSolid, 15)
|
||||
.addBlock(1, 1, 1, ConfigBlocks.blockCosmeticSolid, 11).addBlock(-1, 1, 1, ConfigBlocks.blockCosmeticSolid, 11).addBlock(-1, 1, -1, ConfigBlocks.blockCosmeticSolid, 11).addBlock(1, 1, -1, ConfigBlocks.blockCosmeticSolid, 11);
|
||||
|
||||
public static final MultiblockHelper.MultiblockPattern completeNodeManipulatorMultiblock = new MultiblockHelper.MultiblockPattern(RegisteredBlocks.blockNodeManipulator, 5)
|
||||
.addBlock(0, 2, 0, RegisteredBlocks.blockNode, 0).addBlock(0, 1, 0, Blocks.air, 0)
|
||||
.addBlock(0, 2, 0, RegisteredBlocks.blockNode, 0).addBlock(0, 1, 0, RegisteredBlocks.blockStoneMachine, 0)
|
||||
.addBlock(1, 0, 1, RegisteredBlocks.blockStoneMachine, 15).addBlock(-1, 0, 1, RegisteredBlocks.blockStoneMachine, 15).addBlock(-1, 0, -1, RegisteredBlocks.blockStoneMachine, 15).addBlock(1, 0, -1, RegisteredBlocks.blockStoneMachine, 15)
|
||||
.addBlock(1, 1, 1, RegisteredBlocks.blockStoneMachine, 11).addBlock(-1, 1, 1, RegisteredBlocks.blockStoneMachine, 11).addBlock(-1, 1, -1, RegisteredBlocks.blockStoneMachine, 11).addBlock(1, 1, -1, RegisteredBlocks.blockStoneMachine, 11);
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user