re-enable extra interaction engine checks
Some checks failed
studiorailgun/Renderer/pipeline/head There was a failure building this commit
Some checks failed
studiorailgun/Renderer/pipeline/head There was a failure building this commit
This commit is contained in:
parent
d3769a43d4
commit
e7d2bf42c1
@ -246,66 +246,66 @@ public class ClientInteractionEngine {
|
|||||||
InteractionTargetMenu.setInteractionTargetString(text);
|
InteractionTargetMenu.setInteractionTargetString(text);
|
||||||
set = true;
|
set = true;
|
||||||
}
|
}
|
||||||
// if(!set){
|
if(!set){
|
||||||
// target = Globals.clientState.clientSceneWrapper.getCollisionEngine().rayCast(new Vector3d(centerPos), new Vector3d(eyePos).mul(-1), CollisionEngine.DEFAULT_INTERACT_DISTANCE);
|
target = Globals.clientState.clientSceneWrapper.getCollisionEngine().rayCast(new Vector3d(centerPos), new Vector3d(eyePos).mul(-1), CollisionEngine.DEFAULT_INTERACT_DISTANCE);
|
||||||
// if(target != null){
|
if(target != null){
|
||||||
// EntityType type = CommonEntityUtils.getEntityType(target);
|
EntityType type = CommonEntityUtils.getEntityType(target);
|
||||||
// if(type == null){
|
if(type == null){
|
||||||
// throw new Error("Entity does not have a type defined!");
|
throw new Error("Entity does not have a type defined!");
|
||||||
// }
|
}
|
||||||
// switch(type){
|
switch(type){
|
||||||
// case CREATURE: {
|
case CREATURE: {
|
||||||
// InteractionTargetMenu.setInteractionTargetString(CommonEntityUtils.getEntitySubtype(target));
|
InteractionTargetMenu.setInteractionTargetString(CommonEntityUtils.getEntitySubtype(target));
|
||||||
// set = true;
|
set = true;
|
||||||
// } break;
|
} break;
|
||||||
// case ITEM: {
|
case ITEM: {
|
||||||
// InteractionTargetMenu.setInteractionTargetString(CommonEntityUtils.getEntitySubtype(target));
|
InteractionTargetMenu.setInteractionTargetString(CommonEntityUtils.getEntitySubtype(target));
|
||||||
// set = true;
|
set = true;
|
||||||
// } break;
|
} break;
|
||||||
// case FOLIAGE: {
|
case FOLIAGE: {
|
||||||
// InteractionTargetMenu.setInteractionTargetString(CommonEntityUtils.getEntitySubtype(target));
|
InteractionTargetMenu.setInteractionTargetString(CommonEntityUtils.getEntitySubtype(target));
|
||||||
// set = true;
|
set = true;
|
||||||
// } break;
|
} break;
|
||||||
// default: {
|
default: {
|
||||||
// //silently ignore
|
//silently ignore
|
||||||
// } break;
|
} break;
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
// if(!set){
|
if(!set){
|
||||||
// Vector3d collisionPosition = Globals.clientState.clientSceneWrapper.getCollisionEngine().rayCastPosition(centerPos, new Vector3d(eyePos).mul(-1), CollisionEngine.DEFAULT_INTERACT_DISTANCE);
|
Vector3d collisionPosition = Globals.clientState.clientSceneWrapper.getCollisionEngine().rayCastPosition(centerPos, new Vector3d(eyePos).mul(-1), CollisionEngine.DEFAULT_INTERACT_DISTANCE);
|
||||||
// if(
|
if(
|
||||||
// collisionPosition != null &&
|
collisionPosition != null &&
|
||||||
// collisionPosition.distance(centerPos) < CollisionEngine.DEFAULT_INTERACT_DISTANCE &&
|
collisionPosition.distance(centerPos) < CollisionEngine.DEFAULT_INTERACT_DISTANCE &&
|
||||||
// collisionPosition.x >= 0 && collisionPosition.y >= 0 && collisionPosition.z >= 0
|
collisionPosition.x >= 0 && collisionPosition.y >= 0 && collisionPosition.z >= 0
|
||||||
// ){
|
){
|
||||||
// //grab block at point
|
//grab block at point
|
||||||
// BlockChunkData blockChunkData = Globals.clientState.clientBlockManager.getChunkDataAtWorldPoint(Globals.clientState.clientWorldData.convertRealToWorldSpace(collisionPosition), 0);
|
BlockChunkData blockChunkData = Globals.clientState.clientBlockManager.getChunkDataAtWorldPoint(Globals.clientState.clientWorldData.convertRealToWorldSpace(collisionPosition), 0);
|
||||||
// if(blockChunkData != null){
|
if(blockChunkData != null){
|
||||||
// Vector3i blockPos = ClientWorldData.convertRealToLocalBlockSpace(new Vector3d(collisionPosition).add(new Vector3d(eyePos).mul(-BlockChunkData.BLOCK_SIZE_MULTIPLIER / 2.0f)));
|
Vector3i blockPos = ClientWorldData.convertRealToLocalBlockSpace(new Vector3d(collisionPosition).add(new Vector3d(eyePos).mul(-BlockChunkData.BLOCK_SIZE_MULTIPLIER / 2.0f)));
|
||||||
// if(!blockChunkData.isEmpty(blockPos.x, blockPos.y, blockPos.z)){
|
if(!blockChunkData.isEmpty(blockPos.x, blockPos.y, blockPos.z)){
|
||||||
// short type = blockChunkData.getType(blockPos.x, blockPos.y, blockPos.z);
|
short type = blockChunkData.getType(blockPos.x, blockPos.y, blockPos.z);
|
||||||
// String text = Globals.gameConfigCurrent.getBlockData().getTypeFromId(type).getName();
|
String text = Globals.gameConfigCurrent.getBlockData().getTypeFromId(type).getName();
|
||||||
// InteractionTargetMenu.setInteractionTargetString(text);
|
InteractionTargetMenu.setInteractionTargetString(text);
|
||||||
// Globals.cursorState.hintShowBlockCursor();
|
Globals.cursorState.hintShowBlockCursor();
|
||||||
// Globals.cursorState.hintClampToExistingBlock();
|
Globals.cursorState.hintClampToExistingBlock();
|
||||||
// set = true;
|
set = true;
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
// //if we didn't find a block type, try terrain
|
//if we didn't find a block type, try terrain
|
||||||
// if(!set){
|
if(!set){
|
||||||
// ChunkData chunkData = Globals.clientState.clientTerrainManager.getChunkDataAtWorldPoint(Globals.clientState.clientWorldData.convertRealToWorldSpace(collisionPosition), 0);
|
ChunkData chunkData = Globals.clientState.clientTerrainManager.getChunkDataAtWorldPoint(Globals.clientState.clientWorldData.convertRealToWorldSpace(collisionPosition), 0);
|
||||||
// if(chunkData != null){
|
if(chunkData != null){
|
||||||
// int voxelType = chunkData.getType(ClientWorldData.convertRealToVoxelSpace(new Vector3d(collisionPosition).add(new Vector3d(ServerTerrainChunk.VOXEL_SIZE / 2.0f))));
|
int voxelType = chunkData.getType(ClientWorldData.convertRealToVoxelSpace(new Vector3d(collisionPosition).add(new Vector3d(ServerTerrainChunk.VOXEL_SIZE / 2.0f))));
|
||||||
// if(voxelType != ServerTerrainChunk.VOXEL_TYPE_AIR){
|
if(voxelType != ServerTerrainChunk.VOXEL_TYPE_AIR){
|
||||||
// String text = Globals.gameConfigCurrent.getVoxelData().getTypeFromId(voxelType).getName();
|
String text = Globals.gameConfigCurrent.getVoxelData().getTypeFromId(voxelType).getName();
|
||||||
// InteractionTargetMenu.setInteractionTargetString(text);
|
InteractionTargetMenu.setInteractionTargetString(text);
|
||||||
// set = true;
|
set = true;
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
if(!set){
|
if(!set){
|
||||||
InteractionTargetMenu.setInteractionTargetString("");
|
InteractionTargetMenu.setInteractionTargetString("");
|
||||||
}
|
}
|
||||||
|
|||||||
@ -45,6 +45,7 @@ public class InteractionTargetMenu {
|
|||||||
*/
|
*/
|
||||||
public static void setInteractionTargetString(String text){
|
public static void setInteractionTargetString(String text){
|
||||||
Window interactionTooltipWindow = (Window)Globals.elementService.getWindow(WindowStrings.TARGET_TOOLTIP);
|
Window interactionTooltipWindow = (Window)Globals.elementService.getWindow(WindowStrings.TARGET_TOOLTIP);
|
||||||
|
if(interactionTooltipWindow != null){
|
||||||
Panel container = (Panel)interactionTooltipWindow.getChildren().get(0);
|
Panel container = (Panel)interactionTooltipWindow.getChildren().get(0);
|
||||||
Label label = (Label)container.getChildren().get(0);
|
Label label = (Label)container.getChildren().get(0);
|
||||||
if(text.length() == 0){
|
if(text.length() == 0){
|
||||||
@ -60,5 +61,6 @@ public class InteractionTargetMenu {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user