-
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
8bbfec4
commit 1962cb1
Showing
9 changed files
with
118 additions
and
25 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
13 changes: 13 additions & 0 deletions
13
...n/java/xiamomc/morph/backends/server/renderer/network/datawatcher/values/GhastValues.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 GhastValues extends MobValues | ||
{ | ||
public final SingleValue<Boolean> CHARGING = getSingle(false); | ||
|
||
public GhastValues() | ||
{ | ||
super(); | ||
|
||
registerSingle(CHARGING); | ||
} | ||
} |
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
36 changes: 36 additions & 0 deletions
36
...amomc/morph/backends/server/renderer/network/datawatcher/watchers/types/GhastWatcher.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,36 @@ | ||
package xiamomc.morph.backends.server.renderer.network.datawatcher.watchers.types; | ||
|
||
import com.comphenix.protocol.ProtocolLibrary; | ||
import org.bukkit.entity.EntityType; | ||
import org.bukkit.entity.Player; | ||
import xiamomc.morph.backends.server.renderer.network.PacketFactory; | ||
import xiamomc.morph.backends.server.renderer.network.datawatcher.ValueIndex; | ||
import xiamomc.pluginbase.Annotations.Resolved; | ||
|
||
public class GhastWatcher extends LivingEntityWatcher | ||
{ | ||
@Override | ||
protected void initRegistry() | ||
{ | ||
super.initRegistry(); | ||
|
||
register(ValueIndex.GHAST); | ||
} | ||
|
||
public GhastWatcher(Player bindingPlayer) | ||
{ | ||
super(bindingPlayer, EntityType.GHAST); | ||
} | ||
|
||
@Resolved(shouldSolveImmediately = true) | ||
private PacketFactory packetFactory; | ||
|
||
@Override | ||
protected void onTrackerWrite(int index, Object oldVal, Object newVal) | ||
{ | ||
super.onTrackerWrite(index, oldVal, newVal); | ||
|
||
if (ValueIndex.GHAST.CHARGING.equals(getSingle(index))) | ||
sendPacketToAffectedPlayers(packetFactory.buildMetaPacket(getBindingPlayer(), this)); | ||
} | ||
} |
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