-
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.
- Исправлена ошибка null exception от EntityDeathEvent
- Loading branch information
Showing
22 changed files
with
380 additions
and
44 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
29 changes: 1 addition & 28 deletions
29
src/main/java/com/reider745/behavior/entities/formats/EntitiesVersion113.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 |
---|---|---|
@@ -1,32 +1,5 @@ | ||
package com.reider745.behavior.entities.formats; | ||
|
||
import com.reider745.behavior.entities.EntitiesVersion; | ||
import com.reider745.behavior.entities.EntityContentFactory; | ||
import com.reider745.behavior.entities.TagContentFactory; | ||
import com.reider745.behavior.entities.formats.tags.ComponentsFactory; | ||
import com.reider745.behavior.entities.formats.tags.DescriptionsFactory; | ||
import org.json.JSONObject; | ||
public class EntitiesVersion113 extends EntitiesVersion18 { | ||
|
||
import java.util.ArrayList; | ||
|
||
public class EntitiesVersion113 extends EntitiesVersion { | ||
private static final ArrayList<TagContentFactory> tags = new ArrayList<>(); | ||
|
||
static { | ||
tags.add(new DescriptionsFactory()); | ||
tags.add(new ComponentsFactory()); | ||
} | ||
|
||
@Override | ||
public EntityContentFactory load(JSONObject json) { | ||
final EntityContentFactory entityFactory = new EntityContentFactory(); | ||
|
||
for(TagContentFactory factory : tags){ | ||
if(json.has(factory.getNameTag())){ | ||
factory.loadJSON(entityFactory, json.getJSONObject(factory.getNameTag())); | ||
} | ||
} | ||
|
||
return entityFactory; | ||
} | ||
} |
4 changes: 4 additions & 0 deletions
4
src/main/java/com/reider745/behavior/entities/formats/EntitiesVersion116.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,4 @@ | ||
package com.reider745.behavior.entities.formats; | ||
|
||
public class EntitiesVersion116 extends EntitiesVersion113 { | ||
} |
38 changes: 38 additions & 0 deletions
38
src/main/java/com/reider745/behavior/entities/formats/EntitiesVersion18.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,38 @@ | ||
package com.reider745.behavior.entities.formats; | ||
|
||
import com.reider745.behavior.entities.EntitiesVersion; | ||
import com.reider745.behavior.entities.EntityContentFactory; | ||
import com.reider745.behavior.entities.TagContentFactory; | ||
import com.reider745.behavior.entities.formats.tags.ComponentsFactory; | ||
import com.reider745.behavior.entities.formats.tags.DescriptionsFactory; | ||
import com.reider745.behavior.entities.formats.tags.components.HealthComponent; | ||
import org.json.JSONObject; | ||
|
||
import java.util.ArrayList; | ||
|
||
public class EntitiesVersion18 extends EntitiesVersion { | ||
private static final ArrayList<TagContentFactory> tags = new ArrayList<>(); | ||
|
||
static { | ||
tags.add(new DescriptionsFactory()); | ||
tags.add(new ComponentsFactory()); | ||
} | ||
|
||
@Override | ||
public ArrayList<TagContentFactory> getListTags() { | ||
return tags; | ||
} | ||
|
||
@Override | ||
public EntityContentFactory load(JSONObject json) { | ||
final EntityContentFactory entityFactory = new EntityContentFactory(); | ||
|
||
for(TagContentFactory factory : tags){ | ||
if(json.has(factory.getNameTag())){ | ||
factory.loadJSON(entityFactory, json.getJSONObject(factory.getNameTag())); | ||
} | ||
} | ||
|
||
return entityFactory; | ||
} | ||
} |
Oops, something went wrong.