修改实体类tick方法
This commit is contained in:
parent
9fea16c9b6
commit
7ef3f2c605
2 changed files with 4 additions and 2 deletions
|
@ -239,7 +239,8 @@ public class ProjectileEntity extends Entity implements IEntityAdditionalSpawnDa
|
||||||
this.setPosRaw(this.getX() + vec.x, this.getY() + vec.y, this.getZ() + vec.z);
|
this.setPosRaw(this.getX() + vec.x, this.getY() + vec.y, this.getZ() + vec.z);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.tickCount > 200) {
|
this.tickCount++;
|
||||||
|
if (this.tickCount > 30) {
|
||||||
this.discard();
|
this.discard();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -358,7 +358,8 @@ public class TargetModVariables {
|
||||||
NetworkEvent.Context context = contextSupplier.get();
|
NetworkEvent.Context context = contextSupplier.get();
|
||||||
context.enqueueWork(() -> {
|
context.enqueueWork(() -> {
|
||||||
context.setPacketHandled(true);
|
context.setPacketHandled(true);
|
||||||
if (context.getDirection().getReceptionSide().isServer()) return;
|
if (context.getDirection().getReceptionSide().isServer() || Minecraft.getInstance().player == null)
|
||||||
|
return;
|
||||||
|
|
||||||
PlayerVariables variables = Minecraft.getInstance().player.level().getEntity(message.target).getCapability(PLAYER_VARIABLES_CAPABILITY, null).orElse(new PlayerVariables());
|
PlayerVariables variables = Minecraft.getInstance().player.level().getEntity(message.target).getCapability(PLAYER_VARIABLES_CAPABILITY, null).orElse(new PlayerVariables());
|
||||||
variables.zoom = message.data.zoom;
|
variables.zoom = message.data.zoom;
|
||||||
|
|
Loading…
Add table
Reference in a new issue