mirror of
https://github.com/GTNewHorizons/Gadomancy.git
synced 2026-11-21 04:22:25 +00:00
- NodeManipulator: Multiblock fixxes
- NodeManipulationResults: init - moved node-related stuff to node package
This commit is contained in:
1 parent
0d59f9b90a
commit
3241ac6b5c
17 files changed
+213
-36
No files matched your search
@@ -1,6 +1,6 @@
|
||||
package makeo.gadomancy.client.renderers.tile;
|
||||
|
||||
import makeo.gadomancy.common.blocks.tiles.ExtendedNodeType;
|
||||
import makeo.gadomancy.common.node.ExtendedNodeType;
|
||||
import makeo.gadomancy.common.blocks.tiles.TileExtendedNode;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
@@ -5,6 +5,7 @@ import makeo.gadomancy.client.renderers.block.BlockNodeManipulatorRenderer;
|
||||
import makeo.gadomancy.common.registration.RegisteredBlocks;
|
||||
import makeo.gadomancy.common.utils.SimpleResourceLocation;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.OpenGlHelper;
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.client.renderer.texture.TextureMap;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
@@ -33,6 +34,13 @@ public class RenderTileNodeManipulator extends TileWandPedestalRenderer {
|
||||
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());
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package makeo.gadomancy.client.util;
|
||||
|
||||
import makeo.gadomancy.client.events.ResourceReloadListener;
|
||||
import makeo.gadomancy.common.blocks.tiles.ExtendedNodeType;
|
||||
import makeo.gadomancy.common.node.ExtendedNodeType;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import thaumcraft.api.nodes.NodeType;
|
||||
|
||||
|
||||
@@ -84,6 +84,11 @@ public class BlockNodeManipulator extends BlockStoneDevice {
|
||||
@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);
|
||||
}
|
||||
|
||||
@@ -4,21 +4,20 @@ import cpw.mods.fml.common.network.NetworkRegistry;
|
||||
import makeo.gadomancy.common.Gadomancy;
|
||||
import makeo.gadomancy.common.network.PacketHandler;
|
||||
import makeo.gadomancy.common.network.packets.PacketTCNodeBolt;
|
||||
import makeo.gadomancy.common.node.ExtendedNodeType;
|
||||
import makeo.gadomancy.common.node.GrowingNodeBehavior;
|
||||
import makeo.gadomancy.common.utils.ExplosionHelper;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.world.EnumDifficulty;
|
||||
import thaumcraft.api.ThaumcraftApi;
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
import thaumcraft.api.aspects.AspectList;
|
||||
import thaumcraft.api.aspects.IEssentiaContainerItem;
|
||||
import thaumcraft.api.nodes.INode;
|
||||
import thaumcraft.common.Thaumcraft;
|
||||
@@ -32,7 +31,6 @@ import thaumcraft.common.lib.research.ResearchManager;
|
||||
import thaumcraft.common.tiles.TileNode;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
/**
|
||||
* This class is part of the Gadomancy Mod
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package makeo.gadomancy.common.blocks.tiles;
|
||||
|
||||
import makeo.gadomancy.common.node.ExtendedNodeType;
|
||||
import makeo.gadomancy.common.utils.Injector;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
@@ -14,7 +15,6 @@ import thaumcraft.api.nodes.NodeModifier;
|
||||
import thaumcraft.api.nodes.NodeType;
|
||||
import thaumcraft.common.Thaumcraft;
|
||||
import thaumcraft.common.config.ConfigBlocks;
|
||||
import thaumcraft.common.tiles.TileJar;
|
||||
import thaumcraft.common.tiles.TileJarNode;
|
||||
import thaumcraft.common.tiles.TileNode;
|
||||
|
||||
|
||||
@@ -30,6 +30,12 @@ public class TileManipulatorPillar extends TileInfusionPillar {
|
||||
}
|
||||
}
|
||||
|
||||
public void setOrientation(byte orientation) {
|
||||
this.orientation = orientation;
|
||||
worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
|
||||
markDirty();
|
||||
}
|
||||
|
||||
private static float randomOffset(World worldObj) {
|
||||
return (worldObj.rand.nextFloat() * (worldObj.rand.nextBoolean() ? 1 : -1)) / 2F;
|
||||
}
|
||||
|
||||
@@ -38,12 +38,14 @@ public class TileNodeManipulator extends TileWandPedestal implements IAspectCont
|
||||
public void updateEntity() {
|
||||
ticksExisted++;
|
||||
|
||||
if(isInMultiblock() && ticksExisted % 8 == 0 && !worldObj.isRemote) {
|
||||
if(isInMultiblock() && ticksExisted % 2 == 0 && !worldObj.isRemote) {
|
||||
checkMultiblock();
|
||||
if(!isMultiblockStructurePresent()) {
|
||||
breakMultiblock();
|
||||
isMultiblock = false;
|
||||
}
|
||||
|
||||
//TODO multiblock tick.
|
||||
}
|
||||
}
|
||||
|
||||
@@ -53,7 +55,21 @@ public class TileNodeManipulator extends TileWandPedestal implements IAspectCont
|
||||
}
|
||||
|
||||
public void breakMultiblock() {
|
||||
//TODO break pillars.
|
||||
MultiblockHelper.MultiblockPattern compareableCompleteStructure = RegisteredMultiblocks.completeNodeManipulatorMultiblock;
|
||||
MultiblockHelper.MultiblockPattern toRestore = RegisteredMultiblocks.incompleteNodeManipulatorMultiblock;
|
||||
for(MultiblockHelper.IntVec3 v : compareableCompleteStructure.keySet()) {
|
||||
MultiblockHelper.BlockInfo info = compareableCompleteStructure.get(v);
|
||||
MultiblockHelper.BlockInfo restoreInfo = toRestore.get(v);
|
||||
if(info.block == RegisteredBlocks.blockNode || info.block == Blocks.air || info.block == RegisteredBlocks.blockNodeManipulator || restoreInfo == null) continue;
|
||||
int absX = v.x + xCoord;
|
||||
int absY = v.y + yCoord;
|
||||
int absZ = v.z + zCoord;
|
||||
if(worldObj.getBlock(absX, absY, absZ) == info.block && worldObj.getBlockMetadata(absX, absY, absZ) == info.meta) {
|
||||
worldObj.setBlock(absX, absY, absZ, Blocks.air, 0, 0);
|
||||
worldObj.setBlock(absX, absY, absZ, restoreInfo.block, restoreInfo.meta, 0);
|
||||
worldObj.markBlockForUpdate(absX, absY, absZ);
|
||||
}
|
||||
}
|
||||
|
||||
if(getStackInSlot(0) != null)
|
||||
InventoryUtils.dropItems(worldObj, xCoord, yCoord, zCoord);
|
||||
@@ -61,37 +77,31 @@ public class TileNodeManipulator extends TileWandPedestal implements IAspectCont
|
||||
|
||||
public void formMultiblock() {
|
||||
MultiblockHelper.MultiblockPattern toBuild = RegisteredMultiblocks.completeNodeManipulatorMultiblock;
|
||||
for(Vec3 v : toBuild.keySet()) {
|
||||
for(MultiblockHelper.IntVec3 v : toBuild.keySet()) {
|
||||
MultiblockHelper.BlockInfo info = toBuild.get(v);
|
||||
if(info.block == RegisteredBlocks.blockNode || info.block == Blocks.air || info.block == RegisteredBlocks.blockNodeManipulator) continue;
|
||||
int absX = (int) (v.xCoord + xCoord);
|
||||
int absY = (int) (v.yCoord + yCoord);
|
||||
int absZ = (int) (v.zCoord + zCoord);
|
||||
int absX = v.x + xCoord;
|
||||
int absY = v.y + yCoord;
|
||||
int absZ = v.z + zCoord;
|
||||
worldObj.setBlock(absX, absY, absZ, Blocks.air, 0, 0);
|
||||
worldObj.setBlock(absX, absY, absZ, info.block, info.meta, 0);
|
||||
worldObj.markBlockForUpdate(absX, absY, absZ);
|
||||
}
|
||||
NetworkRegistry.TargetPoint target = new NetworkRegistry.TargetPoint(worldObj.provider.dimensionId, xCoord, yCoord, zCoord, 32);
|
||||
TileManipulatorPillar pillar = (TileManipulatorPillar) worldObj.getTileEntity(xCoord + 1, yCoord, zCoord + 1); //wrong
|
||||
pillar.orientation = 5;
|
||||
worldObj.markBlockForUpdate(pillar.xCoord, pillar.yCoord, pillar.zCoord);
|
||||
pillar.setOrientation((byte) 5);
|
||||
PacketStartAnimation animation = new PacketStartAnimation(PacketStartAnimation.ID_PILLAR_RUNES, pillar.xCoord, pillar.yCoord, pillar.zCoord);
|
||||
PacketHandler.INSTANCE.sendToAllAround(animation, target);
|
||||
pillar.markDirty();
|
||||
TileManipulatorPillar pillar2 = (TileManipulatorPillar) worldObj.getTileEntity(xCoord - 1, yCoord, zCoord + 1);
|
||||
pillar2.orientation = 3; //correct
|
||||
worldObj.markBlockForUpdate(pillar2.xCoord, pillar2.yCoord, pillar2.zCoord);
|
||||
pillar2.setOrientation((byte) 3);
|
||||
animation = new PacketStartAnimation(PacketStartAnimation.ID_PILLAR_RUNES, pillar2.xCoord, pillar2.yCoord, pillar2.zCoord);
|
||||
PacketHandler.INSTANCE.sendToAllAround(animation, target);
|
||||
pillar2.markDirty();
|
||||
TileManipulatorPillar pillar3 = (TileManipulatorPillar) worldObj.getTileEntity(xCoord + 1, yCoord, zCoord - 1); //wrong
|
||||
pillar3.orientation = 4;
|
||||
worldObj.markBlockForUpdate(pillar3.xCoord, pillar3.yCoord, pillar3.zCoord);
|
||||
pillar3.setOrientation((byte) 4);
|
||||
animation = new PacketStartAnimation(PacketStartAnimation.ID_PILLAR_RUNES, pillar3.xCoord, pillar3.yCoord, pillar3.zCoord);
|
||||
PacketHandler.INSTANCE.sendToAllAround(animation, target);
|
||||
animation = new PacketStartAnimation(PacketStartAnimation.ID_PILLAR_RUNES, xCoord - 1, yCoord, zCoord - 1);
|
||||
PacketHandler.INSTANCE.sendToAllAround(animation, target);
|
||||
pillar3.markDirty();
|
||||
markDirty();
|
||||
this.isMultiblock = true;
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ package makeo.gadomancy.common.events;
|
||||
import cpw.mods.fml.common.eventhandler.EventPriority;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import makeo.gadomancy.common.Gadomancy;
|
||||
import makeo.gadomancy.common.blocks.tiles.TileNodeManipulator;
|
||||
import makeo.gadomancy.common.blocks.tiles.TileStickyJar;
|
||||
import makeo.gadomancy.common.registration.RegisteredBlocks;
|
||||
import makeo.gadomancy.common.registration.RegisteredIntegrations;
|
||||
@@ -102,6 +103,19 @@ public class EventHandlerWorld {
|
||||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onBreak(BlockEvent.BreakEvent event) {
|
||||
if(!event.world.isRemote) {
|
||||
if(event.block == RegisteredBlocks.blockNodeManipulator) {
|
||||
TileEntity te = event.world.getTileEntity(event.x, event.y, event.z);
|
||||
if(te != null && te instanceof TileNodeManipulator) {
|
||||
if(((TileNodeManipulator) te).isInMultiblock())
|
||||
((TileNodeManipulator) te).breakMultiblock();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent(priority = EventPriority.LOWEST)
|
||||
public void on(PlayerInteractEvent e) {
|
||||
if (!e.world.isRemote && e.action == PlayerInteractEvent.Action.RIGHT_CLICK_BLOCK
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
package makeo.gadomancy.common.items;
|
||||
|
||||
import makeo.gadomancy.common.blocks.tiles.ExtendedNodeType;
|
||||
import makeo.gadomancy.common.node.ExtendedNodeType;
|
||||
import makeo.gadomancy.common.blocks.tiles.TileExtendedNodeJar;
|
||||
import makeo.gadomancy.common.registration.RegisteredBlocks;
|
||||
import makeo.gadomancy.common.registration.RegisteredItems;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
@@ -24,9 +23,7 @@ import thaumcraft.api.nodes.NodeModifier;
|
||||
import thaumcraft.api.nodes.NodeType;
|
||||
import thaumcraft.common.Thaumcraft;
|
||||
import thaumcraft.common.blocks.ItemJarNode;
|
||||
import thaumcraft.common.config.ConfigBlocks;
|
||||
import thaumcraft.common.config.ConfigItems;
|
||||
import thaumcraft.common.tiles.TileJarNode;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package makeo.gadomancy.common.blocks.tiles;
|
||||
package makeo.gadomancy.common.node;
|
||||
|
||||
/**
|
||||
* This class is part of the Gadomancy Mod
|
||||
+2
-1
@@ -1,7 +1,8 @@
|
||||
package makeo.gadomancy.common.blocks.tiles;
|
||||
package makeo.gadomancy.common.node;
|
||||
|
||||
import cpw.mods.fml.common.network.NetworkRegistry;
|
||||
import makeo.gadomancy.common.Gadomancy;
|
||||
import makeo.gadomancy.common.blocks.tiles.TileExtendedNode;
|
||||
import makeo.gadomancy.common.network.PacketHandler;
|
||||
import makeo.gadomancy.common.network.packets.PacketAnimationAbsorb;
|
||||
import makeo.gadomancy.common.network.packets.PacketTCNodeBolt;
|
||||
@@ -0,0 +1,37 @@
|
||||
package makeo.gadomancy.common.node;
|
||||
|
||||
import makeo.gadomancy.common.blocks.tiles.TileExtendedNode;
|
||||
import net.minecraft.util.WeightedRandom;
|
||||
|
||||
/**
|
||||
* 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
|
||||
*
|
||||
* Created by HellFirePvP @ 28.10.2015 11:45
|
||||
*/
|
||||
public abstract class NodeManipulatorResult extends WeightedRandom.Item {
|
||||
|
||||
private final ResultType effect;
|
||||
|
||||
public NodeManipulatorResult(int chanceToRoll, ResultType effect) {
|
||||
super(chanceToRoll);
|
||||
this.effect = effect;
|
||||
}
|
||||
|
||||
public boolean canAffect(TileExtendedNode node) {
|
||||
return true;
|
||||
}
|
||||
|
||||
public abstract boolean affect(TileExtendedNode node);
|
||||
|
||||
public final ResultType getEffectType() {
|
||||
return effect;
|
||||
}
|
||||
|
||||
public static enum ResultType {
|
||||
NEGATIVE, POSITIVE, NEUTRAL
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
package makeo.gadomancy.common.node;
|
||||
|
||||
import makeo.gadomancy.common.blocks.tiles.TileExtendedNode;
|
||||
import makeo.gadomancy.common.registration.RegisteredManipulations;
|
||||
import net.minecraft.util.WeightedRandom;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
/**
|
||||
* 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 HellFirePvP @ 28.10.2015 11:43
|
||||
*/
|
||||
public class NodeManipulatorResultHandler {
|
||||
|
||||
private static List<NodeManipulatorResult> possibleResults = new ArrayList<NodeManipulatorResult>();
|
||||
|
||||
private NodeManipulatorResultHandler() {}
|
||||
|
||||
public static NodeManipulatorResult getRandomResult(Random random, TileExtendedNode affectedNode) {
|
||||
List<NodeManipulatorResult> localResults = new ArrayList<NodeManipulatorResult>();
|
||||
for(NodeManipulatorResult result : possibleResults) {
|
||||
if(result.canAffect(affectedNode)) localResults.add(result);
|
||||
}
|
||||
if(localResults.isEmpty()) return null;
|
||||
return (NodeManipulatorResult) WeightedRandom.getRandomItem(random, localResults);
|
||||
}
|
||||
|
||||
static {
|
||||
possibleResults.add(RegisteredManipulations.resultBreakCompounds);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package makeo.gadomancy.common.registration;
|
||||
|
||||
import makeo.gadomancy.common.blocks.tiles.TileExtendedNode;
|
||||
import makeo.gadomancy.common.node.NodeManipulatorResult;
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
import thaumcraft.api.aspects.AspectList;
|
||||
|
||||
/**
|
||||
* 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
|
||||
*
|
||||
* Created by HellFirePvP @ 28.10.2015 11:52
|
||||
*/
|
||||
public class RegisteredManipulations {
|
||||
|
||||
public static NodeManipulatorResult resultBreakCompounds = new NodeManipulatorResult(1, NodeManipulatorResult.ResultType.NEUTRAL) {
|
||||
@Override
|
||||
public boolean affect(TileExtendedNode node) {
|
||||
AspectList baseList = node.getAspectsBase();
|
||||
AspectList list = node.getAspects();
|
||||
for(Aspect a : baseList.getAspects()) {
|
||||
if(!a.isPrimal()) {
|
||||
Aspect[] subComponents = a.getComponents();
|
||||
int initialValue = baseList.getAmount(a);
|
||||
list.remove(a);
|
||||
baseList.remove(a);
|
||||
baseList.add(subComponents[0], initialValue);
|
||||
list.add(subComponents[0], initialValue);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
package makeo.gadomancy.common.utils;
|
||||
|
||||
import makeo.gadomancy.common.blocks.tiles.ExtendedNodeType;
|
||||
import makeo.gadomancy.common.node.ExtendedNodeType;
|
||||
import makeo.gadomancy.common.blocks.tiles.TileExtendedNode;
|
||||
import makeo.gadomancy.common.blocks.tiles.TileExtendedNodeJar;
|
||||
import makeo.gadomancy.common.registration.RegisteredBlocks;
|
||||
@@ -19,7 +19,6 @@ import thaumcraft.api.aspects.AspectList;
|
||||
import thaumcraft.api.nodes.INode;
|
||||
import thaumcraft.api.nodes.NodeModifier;
|
||||
import thaumcraft.api.nodes.NodeType;
|
||||
import thaumcraft.common.blocks.BlockJar;
|
||||
import thaumcraft.common.blocks.BlockMagicalLog;
|
||||
import thaumcraft.common.config.ConfigBlocks;
|
||||
import thaumcraft.common.lib.research.ResearchManager;
|
||||
|
||||
@@ -17,16 +17,16 @@ import java.util.LinkedHashMap;
|
||||
public class MultiblockHelper {
|
||||
|
||||
public static boolean isMultiblockPresent(World world, int x, int y, int z, MultiblockPattern pattern) {
|
||||
for(Vec3 vec : pattern.keySet()) {
|
||||
for(IntVec3 vec : pattern.keySet()) {
|
||||
BlockInfo expected = pattern.get(vec);
|
||||
Block realBlock = world.getBlock(x + (int) vec.xCoord, y + (int) vec.yCoord, z + (int) vec.zCoord);
|
||||
int realMeta = world.getBlockMetadata(x + (int) vec.xCoord, y + (int) vec.yCoord, z + (int) vec.zCoord);
|
||||
Block realBlock = world.getBlock(x + vec.x, y + vec.y, z + vec.z);
|
||||
int realMeta = world.getBlockMetadata(x + vec.x, y + vec.y, z + vec.z);
|
||||
if(expected.block != realBlock || expected.meta != realMeta) return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public static class MultiblockPattern extends LinkedHashMap<Vec3, BlockInfo> {
|
||||
public static class MultiblockPattern extends LinkedHashMap<IntVec3, BlockInfo> {
|
||||
|
||||
public MultiblockPattern(Block originBlock, int originMeta) {
|
||||
put(createIntVec3(0, 0, 0), new BlockInfo(originBlock, originMeta));
|
||||
@@ -37,12 +37,39 @@ public class MultiblockHelper {
|
||||
return this;
|
||||
}
|
||||
|
||||
private Vec3 createIntVec3(int x, int y, int z) {
|
||||
return Vec3.createVectorHelper(x, y, z);
|
||||
private IntVec3 createIntVec3(int x, int y, int z) {
|
||||
return new IntVec3(x, y, z);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static class IntVec3 {
|
||||
public int x, y, z;
|
||||
|
||||
public IntVec3(int x, int y, int z) {
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
this.z = z;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
IntVec3 intVec3 = (IntVec3) o;
|
||||
return x == intVec3.x && y == intVec3.y && z == intVec3.z;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
int result = x;
|
||||
result = 31 * result + y;
|
||||
result = 31 * result + z;
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
public static class BlockInfo {
|
||||
public Block block;
|
||||
public int meta;
|
||||
|
||||
Reference in new issue
Block a user