mirror of
https://github.com/GTNewHorizons/Chisel.git
synced 2026-11-17 03:05:10 +00:00
Merge remote-tracking branch 'origin/speed-up' into dev
This commit is contained in:
2 files changed
+23
-22
No files matched your search
@@ -21,31 +21,34 @@ public class BlockConcrete extends BlockCarvable {
|
||||
super();
|
||||
FMLCommonHandler.instance()
|
||||
.bus()
|
||||
.register(this);
|
||||
.register(new EventHandler());
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
private static MovementInput manualInputCheck;
|
||||
|
||||
@SubscribeEvent
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void speedupPlayer(PlayerTickEvent event) {
|
||||
if (event.phase == Phase.START && event.side.isClient()
|
||||
&& event.player.onGround
|
||||
&& event.player instanceof EntityPlayerSP) {
|
||||
if (manualInputCheck == null) {
|
||||
manualInputCheck = new MovementInputFromOptions(Minecraft.getMinecraft().gameSettings);
|
||||
}
|
||||
EntityPlayerSP player = (EntityPlayerSP) event.player;
|
||||
Block below = player.worldObj.getBlock(
|
||||
MathHelper.floor_double(player.posX),
|
||||
MathHelper.floor_double(player.posY) - 2,
|
||||
MathHelper.floor_double(player.posZ));
|
||||
if (below == this) {
|
||||
manualInputCheck.updatePlayerMoveState();
|
||||
if (manualInputCheck.moveForward != 0 || manualInputCheck.moveStrafe != 0) {
|
||||
player.motionX *= Configurations.concreteVelocityMult + 0.05;
|
||||
player.motionZ *= Configurations.concreteVelocityMult + 0.05;
|
||||
public class EventHandler {
|
||||
|
||||
@SubscribeEvent
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void speedupPlayer(PlayerTickEvent event) {
|
||||
if (event.phase == Phase.START && event.side.isClient()
|
||||
&& event.player.onGround
|
||||
&& event.player instanceof EntityPlayerSP) {
|
||||
if (manualInputCheck == null) {
|
||||
manualInputCheck = new MovementInputFromOptions(Minecraft.getMinecraft().gameSettings);
|
||||
}
|
||||
EntityPlayerSP player = (EntityPlayerSP) event.player;
|
||||
Block below = player.worldObj.getBlock(
|
||||
MathHelper.floor_double(player.posX),
|
||||
MathHelper.floor_double(player.posY) - 2,
|
||||
MathHelper.floor_double(player.posZ));
|
||||
if (below == BlockConcrete.this) {
|
||||
manualInputCheck.updatePlayerMoveState();
|
||||
if (manualInputCheck.moveForward != 0 || manualInputCheck.moveStrafe != 0) {
|
||||
player.motionX *= Configurations.concreteVelocityMult + 0.05;
|
||||
player.motionZ *= Configurations.concreteVelocityMult + 0.05;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,7 +14,6 @@ import net.minecraft.init.Items;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
|
||||
import com.cricketcraft.chisel.api.IChiselItem;
|
||||
import com.cricketcraft.chisel.api.carving.ICarvingRegistry;
|
||||
@@ -68,7 +67,6 @@ public class ItemChisel extends Item implements IChiselItem {
|
||||
+ type.name()
|
||||
.toLowerCase());
|
||||
}
|
||||
MinecraftForge.EVENT_BUS.register(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in new issue
Block a user