-
Notifications
You must be signed in to change notification settings - Fork 755
/
AdaptiveSmelteryLogic.java
121 lines (100 loc) · 2.92 KB
/
AdaptiveSmelteryLogic.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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
package tconstruct.blocks.logic;
import java.util.ArrayList;
import java.util.List;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.util.MathHelper;
import net.minecraft.world.World;
import net.minecraftforge.common.ForgeDirection;
import tconstruct.common.TContent;
import tconstruct.library.blocks.AdaptiveInventoryLogic;
import tconstruct.library.component.IComponentHolder;
import tconstruct.library.component.LogicComponent;
import tconstruct.library.component.MultiFluidTank;
import tconstruct.library.component.SmelteryComponent;
import tconstruct.library.component.TankLayerScan;
import tconstruct.library.util.IActiveLogic;
import tconstruct.library.util.IMasterLogic;
public class AdaptiveSmelteryLogic extends AdaptiveInventoryLogic implements IActiveLogic, IMasterLogic, IComponentHolder
{
byte direction;
TankLayerScan structure = new TankLayerScan(this, TContent.smeltery, TContent.lavaTank);
MultiFluidTank multitank = new MultiFluidTank();
SmelteryComponent smeltery = new SmelteryComponent(this, this.worldObj, multitank, 800);
@Override
public byte getRenderDirection ()
{
return direction;
}
@Override
public ForgeDirection getForgeDirection ()
{
return ForgeDirection.VALID_DIRECTIONS[direction];
}
@Override
public void setDirection (int side)
{
}
@Override
public void setDirection (float yaw, float pitch, EntityLivingBase player)
{
int facing = MathHelper.floor_double((double) (yaw / 360) + 0.5D) & 3;
switch (facing)
{
case 0:
direction = 2;
break;
case 1:
direction = 5;
break;
case 2:
direction = 3;
break;
case 3:
direction = 4;
break;
}
}
@Override
public boolean getActive ()
{
// TODO Auto-generated method stub
return false;
}
@Override
public void setActive (boolean flag)
{
// TODO Auto-generated method stub
}
@Override
public void setNeedsUpdate ()
{
// TODO Auto-generated method stub
}
@Override
public Container getGuiContainer (InventoryPlayer inventoryplayer, World world, int x, int y, int z)
{
// TODO Auto-generated method stub
return null;
}
@Override
public String getDefaultName ()
{
return "crafters.Smeltery";
}
@Override
public List<LogicComponent> getComponents ()
{
ArrayList<LogicComponent> ret = new ArrayList<LogicComponent>(1);
ret.add(structure);
ret.add(multitank);
ret.add(smeltery);
return ret;
}
@Override
public void notifyChange (int x, int y, int z)
{
// TODO Auto-generated method stub
}
}