/
Belyash5
/
Flu
Обзор
Документация
Войти
/
Belyash5
/
Flu
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
src/main/java/com/hbm/tileentity/network/TileEntityDroneWaypointRequest.java
43 строки
1 KB
Bob
stalingrad
30 сен 2023, 20:46
30 сен 2023, 20:46
abb96d8
Код
Авторство
О чём код?
package com.hbm.tileentity.network; import com.hbm.tileentity.network.RequestNetwork.PathNode; import com.hbm.util.fauxpointtwelve.BlockPos; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.MathHelper; import net.minecraftforge.common.util.ForgeDirection; public class TileEntityDroneWaypointRequest extends TileEntityRequestNetwork { public int height = 5; @Override public BlockPos getCoord() { ForgeDirection dir = ForgeDirection.getOrientation(this.getBlockMetadata()); return new BlockPos(xCoord + dir.offsetX * height, yCoord + dir.offsetY * height, zCoord + dir.offsetZ * height); } public void addHeight(int h) { height += h; height = MathHelper.clamp_int(height, 1, 15); } @Override public void readFromNBT(NBTTagCompound nbt) { super.readFromNBT(nbt); this.height = nbt.getInteger("height"); } @Override public void writeToNBT(NBTTagCompound nbt) { super.writeToNBT(nbt); nbt.setInteger("height", height); } @Override public PathNode createNode(BlockPos pos) { return new PathNode(pos, this.reachableNodes); } }