Antialiasing
This commit is contained in:
@@ -21,8 +21,8 @@ public class Recipes implements ContentList{
|
||||
//DEFENSE
|
||||
|
||||
//walls
|
||||
new Recipe(defense, Blocks.copperWall, new ItemStack(Items.copper, 12)).setAlwaysUnlocked(true);
|
||||
new Recipe(defense, Blocks.copperWallLarge, new ItemStack(Items.copper, 12 * 4)).setAlwaysUnlocked(true);
|
||||
new Recipe(defense, Blocks.copperWall, new ItemStack(Items.copper, 12));
|
||||
new Recipe(defense, Blocks.copperWallLarge, new ItemStack(Items.copper, 12 * 4));
|
||||
|
||||
new Recipe(defense, Blocks.titaniumWall, new ItemStack(Items.titanium, 12));
|
||||
new Recipe(defense, Blocks.titaniumWallLarge, new ItemStack(Items.titanium, 12 * 4));
|
||||
@@ -70,8 +70,8 @@ public class Recipes implements ContentList{
|
||||
new Recipe(distribution, Blocks.phaseConveyor, new ItemStack(Items.phasefabric, 10), new ItemStack(Items.silicon, 15), new ItemStack(Items.lead, 20), new ItemStack(Items.graphite, 20));
|
||||
|
||||
//starter transport
|
||||
new Recipe(distribution, Blocks.junction, new ItemStack(Items.copper, 2)).setAlwaysUnlocked(true);
|
||||
new Recipe(distribution, Blocks.router, new ItemStack(Items.copper, 6)).setAlwaysUnlocked(true);
|
||||
new Recipe(distribution, Blocks.junction, new ItemStack(Items.copper, 2));
|
||||
new Recipe(distribution, Blocks.router, new ItemStack(Items.copper, 6));
|
||||
|
||||
//more advanced transport
|
||||
new Recipe(distribution, Blocks.distributor, new ItemStack(Items.titanium, 8), new ItemStack(Items.copper, 8));
|
||||
|
||||
@@ -105,13 +105,9 @@ public class ItemTransfer extends TimedEntity implements DrawTrait{
|
||||
|
||||
@Override
|
||||
public void draw(){
|
||||
float length = fslope() * 6f;
|
||||
float angle = current.set(x, y).sub(from).angle();
|
||||
Lines.stroke(fslope() * 2f, Palette.accent);
|
||||
|
||||
Lines.circle(x, y, fslope() * 2f);
|
||||
Lines.lineAngleCenter(x, y, angle, length);
|
||||
Lines.lineAngle(x, y, angle, fout() * 6f);
|
||||
|
||||
Draw.color(item.color);
|
||||
Fill.circle(x, y, fslope() * 1.5f);
|
||||
|
||||
@@ -208,8 +208,6 @@ public class Conveyor extends Block{
|
||||
pos.x = 0f;
|
||||
}
|
||||
pos.x = Mathf.lerpDelta(pos.x, 0, 0.1f);
|
||||
}else{
|
||||
pos.x = Mathf.lerpDelta(pos.x, pos.seed / offsetScl, 0.1f);
|
||||
}
|
||||
|
||||
pos.y = Mathf.clamp(pos.y);
|
||||
@@ -294,7 +292,7 @@ public class Conveyor extends Block{
|
||||
ConveyorEntity entity = tile.entity();
|
||||
|
||||
for(int i = amount - 1; i >= 0; i--){
|
||||
long result = ItemPos.packItem(item, 0f, i * itemSpace, (byte) Mathf.random(255));
|
||||
long result = ItemPos.packItem(item, 0f, i * itemSpace);
|
||||
entity.convey.insert(0, result);
|
||||
entity.items.add(item, 1);
|
||||
}
|
||||
@@ -322,7 +320,7 @@ public class Conveyor extends Block{
|
||||
|
||||
ConveyorEntity entity = tile.entity();
|
||||
entity.noSleep();
|
||||
long result = ItemPos.packItem(item, y * 0.9f, pos, (byte) Mathf.random(255));
|
||||
long result = ItemPos.packItem(item, y * 0.9f, pos);
|
||||
|
||||
tile.entity.items.add(item, 1);
|
||||
|
||||
@@ -399,17 +397,15 @@ public class Conveyor extends Block{
|
||||
|
||||
Item item;
|
||||
float x, y;
|
||||
byte seed;
|
||||
|
||||
private ItemPos(){
|
||||
}
|
||||
|
||||
static long packItem(Item item, float x, float y, byte seed){
|
||||
static long packItem(Item item, float x, float y){
|
||||
short[] shorts = packShorts;
|
||||
shorts[0] = (short) item.id;
|
||||
shorts[1] = (short) (x * Short.MAX_VALUE);
|
||||
shorts[2] = (short) ((y - 1f) * Short.MAX_VALUE);
|
||||
shorts[3] = seed;
|
||||
return Pack.longShorts(shorts);
|
||||
}
|
||||
|
||||
@@ -419,13 +415,11 @@ public class Conveyor extends Block{
|
||||
short itemid = values[0];
|
||||
float x = values[1] / (float) Short.MAX_VALUE;
|
||||
float y = ((float) values[2]) / Short.MAX_VALUE + 1f;
|
||||
byte seed = (byte) values[3];
|
||||
|
||||
byte[] bytes = writeByte;
|
||||
bytes[0] = (byte) itemid;
|
||||
bytes[1] = (byte) (x * 127);
|
||||
bytes[2] = (byte) (y * 255 - 128);
|
||||
bytes[3] = seed;
|
||||
|
||||
return Pack.intBytes(bytes);
|
||||
}
|
||||
@@ -436,13 +430,11 @@ public class Conveyor extends Block{
|
||||
byte itemid = values[0];
|
||||
float x = values[1] / 127f;
|
||||
float y = ((int) values[2] + 128) / 255f;
|
||||
byte seed = values[3];
|
||||
|
||||
short[] shorts = writeShort;
|
||||
shorts[0] = (short) itemid;
|
||||
shorts[1] = (short) (x * Short.MAX_VALUE);
|
||||
shorts[2] = (short) ((y - 1f) * Short.MAX_VALUE);
|
||||
shorts[3] = seed;
|
||||
return Pack.longShorts(shorts);
|
||||
}
|
||||
|
||||
@@ -456,12 +448,11 @@ public class Conveyor extends Block{
|
||||
|
||||
x = values[1] / (float) Short.MAX_VALUE;
|
||||
y = ((float) values[2]) / Short.MAX_VALUE + 1f;
|
||||
seed = (byte) values[3];
|
||||
return this;
|
||||
}
|
||||
|
||||
long pack(){
|
||||
return packItem(item, x, y, seed);
|
||||
return packItem(item, x, y);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user