mirror of
https://github.com/GTNewHorizons/EnderIO.git
synced 2026-11-19 19:59:58 +00:00
#997 EnderIO not letting me edit IO in custom ages.
This commit is contained in:
1 parent
57125cf15e
commit
fa57841b13
1 file changed
+7
-6
@@ -129,7 +129,7 @@ public class IoConfigRenderer {
|
||||
}
|
||||
|
||||
public void init() {
|
||||
initTime = world.getTotalWorldTime();
|
||||
initTime = System.currentTimeMillis();
|
||||
}
|
||||
|
||||
public SelectedFace getSelection() {
|
||||
@@ -158,7 +158,8 @@ public class IoConfigRenderer {
|
||||
distance -= Mouse.getEventDWheel() * 0.01;
|
||||
distance = VecmathUtil.clamp(distance, 0.01, 200);
|
||||
|
||||
long elapsed = world.getTotalWorldTime() - initTime;
|
||||
long elapsed = System.currentTimeMillis() - initTime;
|
||||
|
||||
int x = Mouse.getEventX();
|
||||
int y = Mouse.getEventY();
|
||||
Vector3d start = new Vector3d();
|
||||
@@ -169,7 +170,7 @@ public class IoConfigRenderer {
|
||||
updateSelection(start, end);
|
||||
}
|
||||
|
||||
if(!Mouse.getEventButtonState() && camera.isValid() && elapsed > 10) {
|
||||
if(!Mouse.getEventButtonState() && camera.isValid() && elapsed > 500) {
|
||||
if(Mouse.getEventButton() == 1) {
|
||||
if(selection != null) {
|
||||
selection.config.toggleIoModeForFace(selection.face);
|
||||
@@ -197,13 +198,13 @@ public class IoConfigRenderer {
|
||||
}
|
||||
}
|
||||
selection = null;
|
||||
MovingObjectPosition hit = getClosestHit(Vec3.createVectorHelper(start.x, start.y, start.z), hits);
|
||||
MovingObjectPosition hit = getClosestHit(Vec3.createVectorHelper(start.x, start.y, start.z), hits);
|
||||
if(hit != null) {
|
||||
TileEntity te = world.getTileEntity(hit.blockX, hit.blockY, hit.blockZ);
|
||||
TileEntity te = world.getTileEntity(hit.blockX, hit.blockY, hit.blockZ);
|
||||
if(te instanceof IIoConfigurable) {
|
||||
IIoConfigurable configuarble = (IIoConfigurable) te;
|
||||
ForgeDirection face = ForgeDirection.getOrientation(hit.sideHit);
|
||||
selection = new SelectedFace(configuarble, face);
|
||||
selection = new SelectedFace(configuarble, face);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user