generated from Slimefun/Addon-Template
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from GallowsDove/master
Added missing 1.16 mobs
- Loading branch information
Showing
14 changed files
with
495 additions
and
42 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
35 changes: 35 additions & 0 deletions
35
src/main/java/io/github/thebusybiscuit/mobcapturer/mobs/BeeAdapter.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,35 @@ | ||
package io.github.thebusybiscuit.mobcapturer.mobs; | ||
|
||
import org.bukkit.entity.Bee; | ||
|
||
import com.google.gson.JsonObject; | ||
|
||
public class BeeAdapter extends AnimalsAdapter<Bee> { | ||
|
||
public BeeAdapter() { | ||
super(Bee.class); | ||
} | ||
|
||
@Override | ||
public void apply(Bee entity, JsonObject json) { | ||
super.apply(entity, json); | ||
|
||
entity.setAnger(json.get("anger").getAsInt()); | ||
entity.setCannotEnterHiveTicks(json.get("cannotEnterHiveTicks").getAsInt()); | ||
entity.setHasNectar(json.get("nectar").getAsBoolean()); | ||
entity.setHasStung(json.get("stung").getAsBoolean()); | ||
} | ||
|
||
@Override | ||
public JsonObject saveData(Bee entity) { | ||
JsonObject json = super.saveData(entity); | ||
|
||
json.addProperty("anger", entity.getAnger()); | ||
json.addProperty("cannotEnterHiveTicks", entity.getCannotEnterHiveTicks()); | ||
json.addProperty("nectar", entity.hasNectar()); | ||
json.addProperty("stung", entity.hasStung()); | ||
|
||
return json; | ||
} | ||
|
||
} |
Oops, something went wrong.