fix: перевод, getVelocity
- Исправлен перевод от Item.getName - Исправлен метод Entity.getVelocity(не работает на физику падения, какова хуя :3)
This commit is contained in:
@@ -23,6 +23,8 @@ import com.reider745.api.ReflectHelper;
|
|||||||
import com.reider745.hooks.ItemUtils;
|
import com.reider745.hooks.ItemUtils;
|
||||||
import com.reider745.world.BlockSourceMethods;
|
import com.reider745.world.BlockSourceMethods;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
|
||||||
public class EntityMethod {
|
public class EntityMethod {
|
||||||
public static Entity getEntityToLong(long ent){
|
public static Entity getEntityToLong(long ent){
|
||||||
for (Level level : Server.getInstance().getLevels().values())
|
for (Level level : Server.getInstance().getLevels().values())
|
||||||
@@ -337,10 +339,12 @@ public class EntityMethod {
|
|||||||
public static void getVelocity(long unwrapEntity, float[] pos) {
|
public static void getVelocity(long unwrapEntity, float[] pos) {
|
||||||
Entity entity = getEntityToLong(unwrapEntity);
|
Entity entity = getEntityToLong(unwrapEntity);
|
||||||
if(entity != null){
|
if(entity != null){
|
||||||
Vector3 motion = entity.getMotion();
|
if(entity.lastX == 0 || entity.lastY == 0 || entity.lastZ == 0)
|
||||||
pos[0] = (float) motion.x;
|
return;
|
||||||
pos[1] = (float) motion.y;
|
|
||||||
pos[1] = (float) motion.z;
|
pos[0] = (float) (entity.x - entity.lastX);
|
||||||
|
pos[1] = (float) (entity.y - entity.lastY);
|
||||||
|
pos[2] = (float) (entity.z - entity.lastZ);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import cn.nukkit.item.ItemBlock;
|
|||||||
import com.reider745.api.CustomManager;
|
import com.reider745.api.CustomManager;
|
||||||
import com.reider745.block.CustomBlock;
|
import com.reider745.block.CustomBlock;
|
||||||
import com.zhekasmirnov.horizon.runtime.logger.Logger;
|
import com.zhekasmirnov.horizon.runtime.logger.Logger;
|
||||||
|
import com.zhekasmirnov.innercore.api.runtime.other.NameTranslation;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
@@ -79,11 +80,11 @@ public class ItemMethod {
|
|||||||
public static String getNameForId(int id, int data, long extra){
|
public static String getNameForId(int id, int data, long extra){
|
||||||
CustomManager manager = CustomBlock.getBlockManager(id);
|
CustomManager manager = CustomBlock.getBlockManager(id);
|
||||||
if(manager != null)
|
if(manager != null)
|
||||||
return CustomBlock.getVariants(manager).get(data);
|
return NameTranslation.translate(CustomBlock.getVariants(manager).get(data));
|
||||||
|
|
||||||
manager = getCustomManager(id);
|
manager = getCustomManager(id);
|
||||||
if(manager != null)
|
if(manager != null)
|
||||||
return manager.get(PropertiesNames.NAME);
|
return NameTranslation.translate(manager.get(PropertiesNames.NAME));
|
||||||
return Item.get(id, data).getName();
|
return Item.get(id, data).getName();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user