mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-17 10:55:17 +00:00
Use the entity's speed in tangleberrie pushback, fixes #2085
This commit is contained in:
1 parent
06effc1c44
commit
cab1ce4737
2 files changed
+6
-5
No files matched your search
@@ -10,6 +10,7 @@
|
||||
*/
|
||||
package vazkii.botania.common.block.subtile.functional;
|
||||
|
||||
import net.minecraft.entity.LivingEntity;
|
||||
import net.minecraft.tileentity.TileEntityType;
|
||||
import net.minecraftforge.registries.ObjectHolder;
|
||||
import vazkii.botania.common.lib.LibMisc;
|
||||
@@ -33,8 +34,8 @@ public class SubTileJiyuulia extends SubTileTangleberrie {
|
||||
}
|
||||
|
||||
@Override
|
||||
float getMotionVelocity() {
|
||||
return -super.getMotionVelocity() * 2;
|
||||
float getMotionVelocity(LivingEntity entity) {
|
||||
return -super.getMotionVelocity(entity) * 2;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+3
-3
@@ -63,7 +63,7 @@ public class SubTileTangleberrie extends TileEntityFunctionalFlower {
|
||||
float distance = MathHelper.pointDistanceSpace(x1, y1, z1, x2, y2, z2);
|
||||
|
||||
if(distance > maxDist && distance < range) {
|
||||
MathHelper.setEntityMotionFromVector(entity, new Vector3(x1, y1, z1), getMotionVelocity());
|
||||
MathHelper.setEntityMotionFromVector(entity, new Vector3(x1, y1, z1), getMotionVelocity(entity));
|
||||
if(getWorld().rand.nextInt(3) == 0) {
|
||||
world.addParticle(data, x2 + Math.random() * entity.getWidth(), y2 + Math.random() * entity.getHeight(), z2 + Math.random() * entity.getWidth(), 0, 0, 0);
|
||||
}
|
||||
@@ -85,8 +85,8 @@ public class SubTileTangleberrie extends TileEntityFunctionalFlower {
|
||||
return 7;
|
||||
}
|
||||
|
||||
float getMotionVelocity() {
|
||||
return 0.05F;
|
||||
float getMotionVelocity(LivingEntity entity) {
|
||||
return Math.max(entity.getAIMoveSpeed() / 2F, 0.05F);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in new issue
Block a user