mirror of
https://github.com/Thorfusion/Mekanism-Community-Edition.git
synced 2026-11-22 04:52:25 +00:00
Fix Plastic Road
This commit is contained in:
1 parent
52e21b8c0d
commit
e657681d27
1 file changed
+8
-9
@@ -14,6 +14,7 @@ import net.minecraft.item.EnumDyeColor;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.NonNullList;
|
||||
import net.minecraft.util.math.AxisAlignedBB;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
@@ -56,20 +57,18 @@ public class BlockPlastic extends Block
|
||||
{
|
||||
return state.getValue(BlockStatePlastic.colorProperty).getDyeDamage();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Vec3d modifyAcceleration(World world, BlockPos pos, Entity e, Vec3d motion)
|
||||
{
|
||||
public void onEntityWalk(World worldIn, BlockPos pos, Entity entityIn)
|
||||
{
|
||||
if(type == PlasticBlockType.ROAD)
|
||||
{
|
||||
double boost = 1.6;
|
||||
|
||||
double a = Math.atan2(motion.xCoord, motion.zCoord);
|
||||
return new Vec3d(motion.xCoord + Math.sin(a) * boost * slipperiness, motion.yCoord, motion.zCoord + Math.cos(a) * boost * slipperiness);
|
||||
double a = Math.atan2(entityIn.motionX, entityIn.motionZ);
|
||||
entityIn.motionX += Math.sin(a) * boost * slipperiness;
|
||||
entityIn.motionZ += Math.cos(a) * boost * slipperiness;
|
||||
}
|
||||
|
||||
return motion;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int damageDropped(IBlockState state)
|
||||
|
||||
Reference in new issue
Block a user