-
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
1 parent
19499d8
commit 1668229
Showing
17 changed files
with
285 additions
and
59 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
5 changes: 5 additions & 0 deletions
5
.../java/xiamomc/morph/backends/server/renderer/network/datawatcher/values/AnimalValues.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,5 @@ | ||
package xiamomc.morph.backends.server.renderer.network.datawatcher.values; | ||
|
||
public class AnimalValues extends AgeableMobValues | ||
{ | ||
} |
13 changes: 13 additions & 0 deletions
13
...xiamomc/morph/backends/server/renderer/network/datawatcher/values/ChestedHorseValues.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,13 @@ | ||
package xiamomc.morph.backends.server.renderer.network.datawatcher.values; | ||
|
||
public class ChestedHorseValues extends AbstractHorseValues | ||
{ | ||
public final SingleValue<Boolean> HAS_CHEST = getSingle(false); | ||
|
||
public ChestedHorseValues() | ||
{ | ||
super(); | ||
|
||
registerSingle(HAS_CHEST); | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
...ain/java/xiamomc/morph/backends/server/renderer/network/datawatcher/values/FoxValues.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,18 @@ | ||
package xiamomc.morph.backends.server.renderer.network.datawatcher.values; | ||
|
||
import java.util.UUID; | ||
|
||
public class FoxValues extends AnimalValues | ||
{ | ||
public final SingleValue<Integer> VARIANT = getSingle(0); | ||
public final SingleValue<Byte> FLAGS = getSingle((byte)0); | ||
public final SingleValue<UUID> TRUSTED_ID_0 = getSingle(UUID.randomUUID()); | ||
public final SingleValue<UUID> TRUSTED_ID_1 = getSingle(UUID.randomUUID()); | ||
|
||
public FoxValues() | ||
{ | ||
super(); | ||
|
||
registerSingle(VARIANT, FLAGS); | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
...n/java/xiamomc/morph/backends/server/renderer/network/datawatcher/values/LlamaValues.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,15 @@ | ||
package xiamomc.morph.backends.server.renderer.network.datawatcher.values; | ||
|
||
public class LlamaValues extends ChestedHorseValues | ||
{ | ||
public final SingleValue<Integer> SLOTS = getSingle(0); | ||
public final SingleValue<Integer> CARPET_COLOR = getSingle(-1); | ||
public final SingleValue<Integer> VARIANT = getSingle(0); | ||
|
||
public LlamaValues() | ||
{ | ||
super(); | ||
|
||
registerSingle(SLOTS, CARPET_COLOR, VARIANT); | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
...iamomc/morph/backends/server/renderer/network/datawatcher/watchers/AgeableMobWatcher.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,22 @@ | ||
package xiamomc.morph.backends.server.renderer.network.datawatcher.watchers; | ||
|
||
import org.bukkit.entity.EntityType; | ||
import org.bukkit.entity.Player; | ||
import xiamomc.morph.backends.server.renderer.network.datawatcher.ValueIndex; | ||
import xiamomc.morph.backends.server.renderer.network.datawatcher.watchers.types.LivingEntityWatcher; | ||
|
||
public class AgeableMobWatcher extends LivingEntityWatcher | ||
{ | ||
public AgeableMobWatcher(Player bindingPlayer, EntityType entityType) | ||
{ | ||
super(bindingPlayer, entityType); | ||
} | ||
|
||
@Override | ||
protected void initRegistry() | ||
{ | ||
super.initRegistry(); | ||
|
||
register(ValueIndex.AGEABLE_MOB); | ||
} | ||
} |
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
32 changes: 32 additions & 0 deletions
32
...xiamomc/morph/backends/server/renderer/network/datawatcher/watchers/types/FoxWatcher.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,32 @@ | ||
package xiamomc.morph.backends.server.renderer.network.datawatcher.watchers.types; | ||
|
||
import net.minecraft.nbt.CompoundTag; | ||
import org.bukkit.entity.EntityType; | ||
import org.bukkit.entity.Player; | ||
import xiamomc.morph.backends.server.renderer.network.datawatcher.ValueIndex; | ||
import xiamomc.morph.backends.server.renderer.network.datawatcher.watchers.AgeableMobWatcher; | ||
|
||
public class FoxWatcher extends AgeableMobWatcher | ||
{ | ||
@Override | ||
protected void initRegistry() | ||
{ | ||
super.initRegistry(); | ||
|
||
register(ValueIndex.FOX); | ||
} | ||
|
||
public FoxWatcher(Player bindingPlayer) | ||
{ | ||
super(bindingPlayer, EntityType.FOX); | ||
} | ||
|
||
@Override | ||
public void mergeFromCompound(CompoundTag nbt) | ||
{ | ||
super.mergeFromCompound(nbt); | ||
|
||
var isSnow = nbt.getString("Type").equalsIgnoreCase("SNOW"); | ||
write(ValueIndex.FOX.VARIANT, isSnow ? 1 : 0); | ||
} | ||
} |
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.