remove redundant type casting
detail: item's type is defined as short.
This commit is contained in:
@@ -25,7 +25,7 @@ public class ItemBuffer{
|
|||||||
|
|
||||||
public void accept(Item item, short data){
|
public void accept(Item item, short data){
|
||||||
//if(!accepts()) return;
|
//if(!accepts()) return;
|
||||||
buffer[index++] = Pack.longInt(Float.floatToIntBits(Time.time()), Pack.shortInt((short)item.id, data));
|
buffer[index++] = Pack.longInt(Float.floatToIntBits(Time.time()), Pack.shortInt(item.id, data));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void accept(Item item){
|
public void accept(Item item){
|
||||||
|
|||||||
@@ -406,7 +406,7 @@ public class Conveyor extends Block{
|
|||||||
|
|
||||||
static long packItem(Item item, float x, float y){
|
static long packItem(Item item, float x, float y){
|
||||||
short[] shorts = packShorts;
|
short[] shorts = packShorts;
|
||||||
shorts[0] = (short)item.id;
|
shorts[0] = item.id;
|
||||||
shorts[1] = (short)(x * Short.MAX_VALUE);
|
shorts[1] = (short)(x * Short.MAX_VALUE);
|
||||||
shorts[2] = (short)((y - 1f) * Short.MAX_VALUE);
|
shorts[2] = (short)((y - 1f) * Short.MAX_VALUE);
|
||||||
return Pack.longShorts(shorts);
|
return Pack.longShorts(shorts);
|
||||||
|
|||||||
Reference in New Issue
Block a user