Diff
checker
テキスト
テキスト
画像
ドキュメント
Excel
フォルダ
Legal
Enterprise
デスクトップ
料金
ログイン
Diffchecker デスクトップのダウンロード
テキスト比較
2 つのテキスト ファイルの違いを見つける
ツール
履歴
ライブエディター
空白の変更を非表示
未変更行を折りたたむ
折り返しなし
レイアウト
分割
統合
比較精度
スマート
単語
文字
テキストスタイル
外観を変更
シンタックスハイライト
構文を選択
無視
テキスト変換
最初の差分へ移動
入力を編集
Diffchecker Desktop
Diffcheckerを実行する最も安全な方法。Diffchecker Desktopアプリを入手:あなたの差分はコンピューターから出ることはありません!
Desktopを入手
Untitled diff
作成日
11 年前
差分は期限切れになりません
クリア
エクスポート
共有
説明
8 削除
行
合計
削除
文字
合計
削除
この機能を引き続き使用するには、アップグレードしてください
Diff
checker
Pro
価格を見る
43 行
すべてコピー
5 追加
行
合計
追加
文字
合計
追加
この機能を引き続き使用するには、アップグレードしてください
Diff
checker
Pro
価格を見る
40 行
すべてコピー
コピー
コピー済み
コピー
コピー済み
public class
Hom
ingTask extends BukkitRunnable {
public class
Chas
ingTask extends BukkitRunnable {
private static final double MaxRotationAngle = 0.12;
private static final double TargetSpeed = 1.4;
Arrow arrow;
Arrow arrow;
LivingEntity target;
LivingEntity target;
コピー
コピー済み
コピー
コピー済み
public
Hom
ingTask(final Arrow arrow, final LivingEntity target, final
Plugin
plugin) {
public
Chas
ingTask(final Arrow arrow, final LivingEntity target, final
ChasingArrows
plugin) {
super();
super();
this.arrow = arrow;
this.arrow = arrow;
this.target = target;
this.target = target;
コピー
コピー済み
コピー
コピー済み
this.runTaskTimer(
plugin, 1L, 1L);
this.runTaskTimer(
(Plugin)
plugin, 1L, 1L);
}
}
public void run() {
public void run() {
final double speed = this.arrow.getVelocity().length();
final double speed = this.arrow.getVelocity().length();
if (this.arrow.isOnGround() || this.arrow.isDead() || this.target.isDead()) {
if (this.arrow.isOnGround() || this.arrow.isDead() || this.target.isDead()) {
this.cancel();
this.cancel();
return;
return;
}
}
final Vector toTarget = this.target.getLocation().clone().add(new Vector(0.0, 0.5, 0.0)).subtract(this.arrow.getLocation()).toVector();
final Vector toTarget = this.target.getLocation().clone().add(new Vector(0.0, 0.5, 0.0)).subtract(this.arrow.getLocation()).toVector();
final Vector dirVelocity = this.arrow.getVelocity().clone().normalize();
final Vector dirVelocity = this.arrow.getVelocity().clone().normalize();
final Vector dirToTarget = toTarget.clone().normalize();
final Vector dirToTarget = toTarget.clone().normalize();
final double angle = dirVelocity.angle(dirToTarget);
final double angle = dirVelocity.angle(dirToTarget);
コピー
コピー済み
コピー
コピー済み
double newSpeed = 0.9 * speed + 0.
13999999999999999
;
double newSpeed = 0.9 * speed + 0.
14
;
if (this.target instanceof Player && this.arrow.getLocation().distance(this.target.getLocation()) < 8.0) {
if (this.target instanceof Player && this.arrow.getLocation().distance(this.target.getLocation()) < 8.0) {
final Player player = (Player)this.target;
final Player player = (Player)this.target;
if (player.isBlocking()) {
if (player.isBlocking()) {
newSpeed = speed * 0.6;
newSpeed = speed * 0.6;
}
}
}
}
Vector newVelocity;
Vector newVelocity;
if (angle < 0.12) {
if (angle < 0.12) {
newVelocity = dirVelocity.clone().multiply(newSpeed);
newVelocity = dirVelocity.clone().multiply(newSpeed);
}
}
else {
else {
final Vector newDir = dirVelocity.clone().multiply((angle - 0.12) / angle).add(dirToTarget.clone().multiply(0.12 / angle));
final Vector newDir = dirVelocity.clone().multiply((angle - 0.12) / angle).add(dirToTarget.clone().multiply(0.12 / angle));
newDir.normalize();
newDir.normalize();
newVelocity = newDir.clone().multiply(newSpeed);
newVelocity = newDir.clone().multiply(newSpeed);
}
}
this.arrow.setVelocity(newVelocity.add(new Vector(0.0, 0.03, 0.0)));
this.arrow.setVelocity(newVelocity.add(new Vector(0.0, 0.03, 0.0)));
コピー
コピー済み
コピー
コピー済み
this.arrow.getWorld().playEffect(this.arrow.getLocation(), Effect.SMOKE, 0);
}
}
}
}
保存された差分
原文
ファイルを開く
public class HomingTask extends BukkitRunnable { private static final double MaxRotationAngle = 0.12; private static final double TargetSpeed = 1.4; Arrow arrow; LivingEntity target; public HomingTask(final Arrow arrow, final LivingEntity target, final Plugin plugin) { super(); this.arrow = arrow; this.target = target; this.runTaskTimer(plugin, 1L, 1L); } public void run() { final double speed = this.arrow.getVelocity().length(); if (this.arrow.isOnGround() || this.arrow.isDead() || this.target.isDead()) { this.cancel(); return; } final Vector toTarget = this.target.getLocation().clone().add(new Vector(0.0, 0.5, 0.0)).subtract(this.arrow.getLocation()).toVector(); final Vector dirVelocity = this.arrow.getVelocity().clone().normalize(); final Vector dirToTarget = toTarget.clone().normalize(); final double angle = dirVelocity.angle(dirToTarget); double newSpeed = 0.9 * speed + 0.13999999999999999; if (this.target instanceof Player && this.arrow.getLocation().distance(this.target.getLocation()) < 8.0) { final Player player = (Player)this.target; if (player.isBlocking()) { newSpeed = speed * 0.6; } } Vector newVelocity; if (angle < 0.12) { newVelocity = dirVelocity.clone().multiply(newSpeed); } else { final Vector newDir = dirVelocity.clone().multiply((angle - 0.12) / angle).add(dirToTarget.clone().multiply(0.12 / angle)); newDir.normalize(); newVelocity = newDir.clone().multiply(newSpeed); } this.arrow.setVelocity(newVelocity.add(new Vector(0.0, 0.03, 0.0))); this.arrow.getWorld().playEffect(this.arrow.getLocation(), Effect.SMOKE, 0); } }
変更されたテキスト
ファイルを開く
public class ChasingTask extends BukkitRunnable { Arrow arrow; LivingEntity target; public ChasingTask(final Arrow arrow, final LivingEntity target, final ChasingArrows plugin) { super(); this.arrow = arrow; this.target = target; this.runTaskTimer((Plugin)plugin, 1L, 1L); } public void run() { final double speed = this.arrow.getVelocity().length(); if (this.arrow.isOnGround() || this.arrow.isDead() || this.target.isDead()) { this.cancel(); return; } final Vector toTarget = this.target.getLocation().clone().add(new Vector(0.0, 0.5, 0.0)).subtract(this.arrow.getLocation()).toVector(); final Vector dirVelocity = this.arrow.getVelocity().clone().normalize(); final Vector dirToTarget = toTarget.clone().normalize(); final double angle = dirVelocity.angle(dirToTarget); double newSpeed = 0.9 * speed + 0.14; if (this.target instanceof Player && this.arrow.getLocation().distance(this.target.getLocation()) < 8.0) { final Player player = (Player)this.target; if (player.isBlocking()) { newSpeed = speed * 0.6; } } Vector newVelocity; if (angle < 0.12) { newVelocity = dirVelocity.clone().multiply(newSpeed); } else { final Vector newDir = dirVelocity.clone().multiply((angle - 0.12) / angle).add(dirToTarget.clone().multiply(0.12 / angle)); newDir.normalize(); newVelocity = newDir.clone().multiply(newSpeed); } this.arrow.setVelocity(newVelocity.add(new Vector(0.0, 0.03, 0.0))); } }
違いを見つける