/
Belyash5
/
Flu
Обзор
Документация
Войти
/
Belyash5
/
Flu
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
src/main/java/com/hbm/tileentity/network/TileEntityConnector.java
43 строки
1 KB
Boblet
We must construct additional pylons!!
12 апр 2024, 14:45
12 апр 2024, 14:45
be3147c
Код
Авторство
О чём код?
package com.hbm.tileentity.network; import com.hbm.util.fauxpointtwelve.BlockPos; import com.hbm.util.fauxpointtwelve.DirPos; import api.hbm.energymk2.Nodespace.PowerNode; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.Vec3; import net.minecraftforge.common.util.ForgeDirection; public class TileEntityConnector extends TileEntityPylonBase { @Override public ConnectionType getConnectionType() { return ConnectionType.SINGLE; } @Override public Vec3[] getMountPos() { return new Vec3[] {Vec3.createVectorHelper(0.5, 0.5, 0.5)}; } @Override public double getMaxWireLength() { return 10; } @Override public PowerNode createNode() { TileEntity tile = (TileEntity) this; ForgeDirection dir = ForgeDirection.getOrientation(this.getBlockMetadata()).getOpposite(); PowerNode node = new PowerNode(new BlockPos(tile.xCoord, tile.yCoord, tile.zCoord)).setConnections( new DirPos(xCoord, yCoord, zCoord, ForgeDirection.UNKNOWN), new DirPos(xCoord + dir.offsetX, yCoord + dir.offsetY, zCoord + dir.offsetZ, dir)); for(int[] pos : this.connected) node.addConnection(new DirPos(pos[0], pos[1], pos[2], ForgeDirection.UNKNOWN)); return node; } @Override public boolean canConnect(ForgeDirection dir) { //i've about had it with your fucking bullshit return ForgeDirection.getOrientation(this.getBlockMetadata()).getOpposite() == dir; } }