-
Notifications
You must be signed in to change notification settings - Fork 497
/
FacadePluggable.java
103 lines (79 loc) · 2.35 KB
/
FacadePluggable.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
package buildcraft.transport;
import io.netty.buffer.ByteBuf;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.AxisAlignedBB;
import net.minecraftforge.common.util.Constants;
import net.minecraftforge.common.util.ForgeDirection;
import buildcraft.api.pipes.IPipeContainer;
import buildcraft.api.pipes.IPipePluggable;
import buildcraft.api.pipes.IPipePluggableRenderer;
import buildcraft.core.utils.MatrixTranformations;
public class FacadePluggable implements IPipePluggable {
public ItemFacade.FacadeState[] states;
public FacadePluggable(ItemFacade.FacadeState[] states) {
this.states = states;
}
public FacadePluggable() {
}
@Override
public void writeToNBT(NBTTagCompound nbt) {
if (states != null) {
nbt.setTag("states", ItemFacade.FacadeState.writeArray(states));
}
}
@Override
public void readFromNBT(NBTTagCompound nbt) {
if (nbt.hasKey("states")) {
states = ItemFacade.FacadeState.readArray(nbt.getTagList("states", Constants.NBT.TAG_COMPOUND));
}
}
@Override
public ItemStack[] getDropItems(IPipeContainer pipe) {
return states == null ? null : new ItemStack[] { ItemFacade.getFacade(states) };
}
@Override
public void update(IPipeContainer pipe, ForgeDirection direction) {
}
@Override
public void onAttachedPipe(IPipeContainer pipe, ForgeDirection direction) {
}
@Override
public void onDetachedPipe(IPipeContainer pipe, ForgeDirection direction) {
}
@Override
public boolean isBlocking(IPipeContainer pipe, ForgeDirection direction) {
return false;
}
@Override
public void invalidate() {
}
@Override
public void validate(IPipeContainer pipe, ForgeDirection direction) {
}
@Override
public AxisAlignedBB getBoundingBox(ForgeDirection side) {
float[][] bounds = new float[3][2];
// X START - END
bounds[0][0] = 0.0F;
bounds[0][1] = 1.0F;
// Y START - END
bounds[1][0] = 0.0F;
bounds[1][1] = TransportConstants.FACADE_THICKNESS;
// Z START - END
bounds[2][0] = 0.0F;
bounds[2][1] = 1.0F;
MatrixTranformations.transform(bounds, side);
return AxisAlignedBB.getBoundingBox(bounds[0][0], bounds[1][0], bounds[2][0], bounds[0][1], bounds[1][1], bounds[2][1]);
}
@Override
public IPipePluggableRenderer getRenderer() {
return null;
}
@Override
public void writeData(ByteBuf data) {
}
@Override
public void readData(ByteBuf data) {
}
}