-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Думал что-то сделаю, потом понял что мне лень этим заниматься
- Loading branch information
Showing
25 changed files
with
217 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...mats/tags/components/AttackComponent.java → ...gs/components/attack/AttackComponent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
...a/com/reider745/behavior/entities/formats/tags/components/attack/ProjectileComponent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package com.reider745.behavior.entities.formats.tags.components.attack; | ||
|
||
import com.reider745.behavior.entities.ComponentsTag; | ||
import com.reider745.behavior.entities.EntityContentFactory; | ||
|
||
public class ProjectileComponent extends ComponentsTag { | ||
@Override | ||
public String getNameTag() { | ||
return "minecraft:projectile"; | ||
} | ||
|
||
@Override | ||
public void load(EntityContentFactory factory, Object json) { | ||
// TODO: BEHAVIOR | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
...a/com/reider745/behavior/entities/formats/tags/components/collision/BalloonComponent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package com.reider745.behavior.entities.formats.tags.components.collision; | ||
|
||
import cn.nukkit.math.Vector3; | ||
import com.reider745.behavior.entities.ComponentsTag; | ||
import com.reider745.behavior.entities.EntityContentFactory; | ||
import org.json.JSONArray; | ||
import org.json.JSONObject; | ||
|
||
public class BalloonComponent extends ComponentsTag { | ||
@Override | ||
public String getNameTag() { | ||
return "minecraft:balloon"; | ||
} | ||
|
||
@Override | ||
public void load(EntityContentFactory factory, Object json) { | ||
if(json instanceof JSONObject jsonObject) { | ||
final JSONArray leftForce = jsonObject.getJSONArray("lift_force"); | ||
factory.liftForce = new Vector3(leftForce.getDouble(0), leftForce.getDouble(1), leftForce.getDouble(2)); | ||
} else | ||
throw new RuntimeException("Error loaded entity"); | ||
|
||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
...s/tags/components/CollisionComponent.java → ...ponents/collision/CollisionComponent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...ats/tags/components/GravityComponent.java → ...omponents/collision/GravityComponent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
...ava/com/reider745/behavior/entities/formats/tags/components/life/BreathableComponent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
package com.reider745.behavior.entities.formats.tags.components.life; | ||
|
||
import com.reider745.behavior.entities.ComponentsTag; | ||
import com.reider745.behavior.entities.CustomEntity; | ||
import com.reider745.behavior.entities.EntityContentFactory; | ||
import com.reider745.behavior.entities.formats.tags.components.IUpdateEntity; | ||
import org.json.JSONObject; | ||
|
||
public class BreathableComponent extends ComponentsTag implements IUpdateEntity { | ||
public int totalSupply, suffocateTime; | ||
public double inhaleTime; | ||
public boolean generatesBubbles; | ||
|
||
@Override | ||
public String getNameTag() { | ||
return "minecraft:breathable"; | ||
} | ||
|
||
@Override | ||
public void load(EntityContentFactory factory, Object json) { | ||
if(json instanceof JSONObject jsonObject) { | ||
final BreathableComponent component = new BreathableComponent(); | ||
|
||
component.totalSupply = jsonObject.getInt("total_supply"); | ||
component.suffocateTime = jsonObject.optInt("suffocate_time", 0); | ||
component.inhaleTime = jsonObject.optDouble("inhale_time", 2.0); | ||
component.generatesBubbles = jsonObject.optBoolean("generates_bubbles", false); | ||
|
||
factory.addUpdate(component); | ||
} else | ||
throw new RuntimeException("Not support"); | ||
} | ||
|
||
@Override | ||
public int getPriority() { | ||
return IUpdateEntity.super.getPriority(); | ||
} | ||
|
||
@Override | ||
public void onUpdate(CustomEntity entity) { | ||
// TODO: BEHAVIOR | ||
} | ||
} |
3 changes: 2 additions & 1 deletion
3
...mats/tags/components/BurnsInDaylight.java → ...tags/components/life/BurnsInDaylight.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
.../tags/components/FireImmuneComponent.java → .../components/life/FireImmuneComponent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...mats/tags/components/HealthComponent.java → ...tags/components/life/HealthComponent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
...com/reider745/behavior/entities/formats/tags/components/navigation/CanClimbComponent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package com.reider745.behavior.entities.formats.tags.components.navigation; | ||
|
||
import com.reider745.behavior.entities.ComponentsTag; | ||
import com.reider745.behavior.entities.EntityContentFactory; | ||
|
||
public class CanClimbComponent extends ComponentsTag { | ||
@Override | ||
public String getNameTag() { | ||
return "minecraft:can_climb"; | ||
} | ||
|
||
@Override | ||
public void load(EntityContentFactory factory, Object json) { | ||
factory.canClimb = true; | ||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
...ormats/tags/components/JumpComponent.java → .../components/navigation/JumpComponent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...gs/components/MovementBasicComponent.java → ...ts/navigation/MovementBasicComponent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...ts/tags/components/MovementComponent.java → ...ponents/navigation/MovementComponent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.