mirror of
https://github.com/TicTicBoooom-Mods/MasterfulMachinery.git
synced 2026-01-18 16:37:23 +01:00
Centered the render in JEI
This commit is contained in:
@@ -59,7 +59,7 @@
|
||||
"name": "Rotation",
|
||||
"id": "simple",
|
||||
"data": {
|
||||
"stress": 1
|
||||
"stress": 32
|
||||
}
|
||||
},
|
||||
{
|
||||
|
||||
@@ -65,7 +65,7 @@
|
||||
"name": "Rotation",
|
||||
"id": "intermediate",
|
||||
"data": {
|
||||
"stress": 3
|
||||
"stress": 128
|
||||
}
|
||||
},
|
||||
{
|
||||
|
||||
@@ -137,19 +137,19 @@ public class MachineStructureRecipeCategory implements IRecipeCategory<MachineSt
|
||||
}
|
||||
|
||||
// Calculate distances
|
||||
int furthestX = Integer.MAX_VALUE;
|
||||
int nearestX = Integer.MIN_VALUE;
|
||||
int furthestZ = Integer.MAX_VALUE;
|
||||
int nearestZ = Integer.MIN_VALUE;
|
||||
int topY = Integer.MIN_VALUE;
|
||||
int bottomY = Integer.MAX_VALUE;
|
||||
int minX = Integer.MAX_VALUE;
|
||||
int maxX = Integer.MIN_VALUE;
|
||||
int minZ = Integer.MAX_VALUE;
|
||||
int maxZ = Integer.MIN_VALUE;
|
||||
int minY = Integer.MAX_VALUE;
|
||||
int maxY = Integer.MIN_VALUE;
|
||||
for (MachineStructureRecipeKeyModel part : recipe.getModels().get(0)) {
|
||||
furthestX = Math.min(part.getPos().getX(), furthestX);
|
||||
nearestX = Math.max(part.getPos().getX(), nearestX);
|
||||
furthestZ = Math.min(part.getPos().getZ(), furthestZ);
|
||||
nearestZ = Math.max(part.getPos().getZ(), nearestZ);
|
||||
topY = Math.max(part.getPos().getY(), topY);
|
||||
bottomY = Math.min(part.getPos().getY(), bottomY);
|
||||
minX = Math.min(part.getPos().getX(), minX);
|
||||
maxX = Math.max(part.getPos().getX(), maxX);
|
||||
minZ = Math.min(part.getPos().getZ(), minZ);
|
||||
maxZ = Math.max(part.getPos().getZ(), maxZ);
|
||||
minY = Math.min(part.getPos().getY(), minY);
|
||||
maxY = Math.max(part.getPos().getY(), maxY);
|
||||
}
|
||||
|
||||
// Do mouse scroll zoom
|
||||
@@ -160,11 +160,9 @@ public class MachineStructureRecipeCategory implements IRecipeCategory<MachineSt
|
||||
scaleFactor += (mouseY - yLastMousePosition) * 0.05;
|
||||
scaleFactor = Math.max(0.003f, scaleFactor);
|
||||
}
|
||||
nearestX++;
|
||||
nearestZ++;
|
||||
float centreX = ((float) nearestX - furthestX) / 2f;
|
||||
float centerY = ((float) topY - bottomY) / 2f;
|
||||
float centreZ = ((float) nearestZ - furthestZ) / 2f;
|
||||
float centreX = ((float) maxX - minX) / 2f;
|
||||
float centerY = ((float) maxY - minY) / 2f;
|
||||
float centreZ = ((float) maxZ - minZ) / 2f;
|
||||
mc.fontRenderer.drawString(matrixStack, recipe.getName(), 2, 2, 0xFFFFFFFF);
|
||||
|
||||
// Get the block parts for the layer
|
||||
@@ -174,13 +172,13 @@ public class MachineStructureRecipeCategory implements IRecipeCategory<MachineSt
|
||||
}
|
||||
|
||||
//float tx = 6.5f, ty = -5, tz = 10;
|
||||
float tx = 0, ty = 0, tz = 10;
|
||||
float tx = 6.75f, ty = -5, tz = 10;
|
||||
Vector3f prePos = new Vector3f(tx, ty, tz);
|
||||
Vector3f offset = new Vector3f(centreX / 2, centerY / 2, centreZ / 2);
|
||||
Vector3f offset = new Vector3f(-minX - 0.5f - centreX, -minY - 0.5f - centerY, -minZ - 0.5f + centreZ);
|
||||
|
||||
// Render the block parts
|
||||
for (MachineStructureRecipeKeyModel part : parts) {
|
||||
variantIndices.putIfAbsent(part.getPos(), 0);
|
||||
this.variantIndices.putIfAbsent(part.getPos(), 0);
|
||||
if (part.getBlock().isEmpty() && part.getTag().isEmpty() && part.getPort() == null) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
"type": "masterfulmachinery:machine_process",
|
||||
"structureId": "test_rotation",
|
||||
"controllerId": "basic",
|
||||
"ticks": 200,
|
||||
"perTick": true,
|
||||
"inputs": [
|
||||
{
|
||||
"type": "masterfulmachinery:create_rotation",
|
||||
@@ -15,7 +15,7 @@
|
||||
{
|
||||
"type": "masterfulmachinery:create_rotation",
|
||||
"data": {
|
||||
"speed": 4
|
||||
"speed": 64
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
#Tue Sep 28 18:52:49 BST 2021
|
||||
VERSION_CODE=785
|
||||
#Wed Sep 29 10:53:26 BST 2021
|
||||
VERSION_CODE=790
|
||||
|
||||
Reference in New Issue
Block a user