-
Notifications
You must be signed in to change notification settings - Fork 9
A lot of events #9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
yunuservices
wants to merge
56
commits into
Pumpkin-MC:master
Choose a base branch
from
yunuservices:feat/full-compability
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
56 commits
Select commit
Hold shift + click to select a range
ab9e2f4
Add core player event bridge
yunuservices a1f66a3
Add server command and broadcast events
yunuservices 6d0b455
Add block and interact event bridge
yunuservices f63621a
Add native block lookup bridge
yunuservices b91f9e8
Document GraalVM JVM compatibility
yunuservices 0dc86ce
Enhance interact and entity event bridge
yunuservices b324772
Add player login/teleport/world/gamemode event bridge
yunuservices e5982af
Add prelogin, advancement, and animation event bridge
yunuservices f9499b5
Add armor stand manipulate event bridge
yunuservices c27f40d
Add bed enter/leave event bridge
yunuservices 80e44eb
Add bucket events bridge
yunuservices 9879203
Add PlayerChangedMainHandEvent
yunuservices 95437f9
Add player channel events
yunuservices 4bfe660
Add command preprocess/send events
yunuservices 7dc20ec
Add PlayerDropItemEvent
yunuservices 1801529
Add PlayerEditBookEvent
yunuservices 7507781
Add PlayerEggThrowEvent
yunuservices 585a412
Add PlayerExpChangeEvent
yunuservices 87e6d23
Add PlayerFishEvent
yunuservices b2dbd98
Add player entity interaction events
yunuservices d485ab7
Add PlayerItemHeldEvent bridge
yunuservices bba9d21
Add player item damage/consume/mend events
yunuservices a4005b5
Add player kick and level change events
yunuservices 1e73933
Add player toggle and swap hand events
yunuservices 8b12bef
Add resource pack status and respawn events
yunuservices a56249b
Add portal, velocity, and misc player events
yunuservices bfdf350
Add player harvest block event
yunuservices 6545c56
Add block can build and burn events
yunuservices d11b839
Add block ignite event
yunuservices e59c1e6
Add block spread event
yunuservices 7814906
Add block damage events
yunuservices b062673
Add BlockDispenseEvent bridge
yunuservices f49b3e3
Add BlockDropItemEvent bridge
yunuservices 3c4ae91
Add BlockExplodeEvent bridge
yunuservices c79540d
Add BlockFadeEvent bridge
yunuservices 30c75f9
Add BlockFertilizeEvent bridge
yunuservices 2a19cbb
Add BlockFormEvent bridge
yunuservices 1bf504b
Add BlockFromToEvent bridge
yunuservices b92b5bd
Add BlockGrowEvent bridge
yunuservices a619e38
Add piston extend/retract events bridge
yunuservices a222a6a
Add BlockRedstoneEvent bridge
yunuservices 3f7bfcc
Add BlockMultiPlace and BlockPhysics events bridge
yunuservices 50a126d
Add note/sign/tnt/moisture/sponge/fluid events
yunuservices 0a23ea0
Add SpawnChangeEvent
yunuservices 0b7bf00
Add ServerListPingEvent
yunuservices 3762641
Bridge plugin and service server events
yunuservices 60c3925
Restore rust Cargo.toml to upstream deps
yunuservices 271da00
Fix event compatibility and java bridge helpers
yunuservices 0b95ca1
Align PatchBukkit runtime with current event support
yunuservices 6ee1092
Align bridge with local Pumpkin events and verify server-test
yunuservices 63e874a
Use git-based Pumpkin dependencies on feat/events
yunuservices 258062c
Refresh lockfile after rebasing Pumpkin feat/events
yunuservices 635f40d
Fix critical bridge issues for ignite and world mapping
yunuservices 54da03f
chore(rust): bump Pumpkin dependency lock to ba0410c3
yunuservices 1dd858f
fix(rust): resolve clippy warnings in event bridge handlers
yunuservices 85095a4
fix: address review feedback across bridge and runtime sync
yunuservices File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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
158 changes: 158 additions & 0 deletions
158
java/patchbukkit/src/main/java/org/patchbukkit/entity/PatchBukkitAbstractArrow.java
This file contains hidden or 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,158 @@ | ||
| package org.patchbukkit.entity; | ||
|
|
||
| import java.util.UUID; | ||
|
|
||
| import org.bukkit.Material; | ||
| import org.bukkit.Sound; | ||
| import org.bukkit.block.Block; | ||
| import org.bukkit.entity.AbstractArrow; | ||
| import org.bukkit.inventory.ItemStack; | ||
| import org.jetbrains.annotations.NotNull; | ||
| import java.util.Collections; | ||
| import java.util.List; | ||
|
|
||
| public class PatchBukkitAbstractArrow extends PatchBukkitProjectile implements AbstractArrow { | ||
| private PickupStatus pickupStatus = PickupStatus.ALLOWED; | ||
| private double damage = 2.0; | ||
| private int knockbackStrength = 0; | ||
| private int pierceLevel = 0; | ||
| private boolean critical = false; | ||
| private boolean inBlock = false; | ||
| private boolean shotFromCrossbow = false; | ||
| private boolean noPhysics = false; | ||
| private int lifetimeTicks = 0; | ||
| private ItemStack item = new ItemStack(Material.ARROW, 1); | ||
| private ItemStack weapon = null; | ||
| private Sound hitSound = Sound.ENTITY_ARROW_HIT; | ||
|
|
||
| public PatchBukkitAbstractArrow(UUID uuid, String name) { | ||
| super(uuid, name); | ||
| warnSnapshotLimitation( | ||
| "entity:abstract_arrow_snapshot", | ||
| "PatchBukkitAbstractArrow uses fallback local values; Pumpkin does not fully expose arrow/bow runtime state yet." | ||
| ); | ||
| } | ||
|
|
||
| public Block getAttachedBlock() { | ||
| return null; | ||
| } | ||
|
|
||
| @Override | ||
| public @NotNull List<Block> getAttachedBlocks() { | ||
| return Collections.emptyList(); | ||
| } | ||
|
|
||
| public double getDamage() { | ||
| return damage; | ||
| } | ||
|
|
||
| public void setDamage(double damage) { | ||
| this.damage = damage; | ||
| } | ||
|
|
||
| public int getKnockbackStrength() { | ||
| return knockbackStrength; | ||
| } | ||
|
|
||
| public void setKnockbackStrength(int knockbackStrength) { | ||
| this.knockbackStrength = knockbackStrength; | ||
| } | ||
|
|
||
| public PickupStatus getPickupStatus() { | ||
| return pickupStatus; | ||
| } | ||
|
|
||
| public void setPickupStatus(PickupStatus status) { | ||
| this.pickupStatus = status; | ||
| } | ||
|
|
||
| public int getPierceLevel() { | ||
| return pierceLevel; | ||
| } | ||
|
|
||
| public void setPierceLevel(int pierceLevel) { | ||
| this.pierceLevel = pierceLevel; | ||
| } | ||
|
|
||
| public boolean isCritical() { | ||
| return critical; | ||
| } | ||
|
|
||
| public void setCritical(boolean critical) { | ||
| this.critical = critical; | ||
| } | ||
|
|
||
| public boolean isInBlock() { | ||
| return inBlock; | ||
| } | ||
|
|
||
| public boolean isShotFromCrossbow() { | ||
| return shotFromCrossbow; | ||
| } | ||
|
|
||
| public void setShotFromCrossbow(boolean shotFromCrossbow) { | ||
| this.shotFromCrossbow = shotFromCrossbow; | ||
| } | ||
|
|
||
| public ItemStack getItem() { | ||
| return item; | ||
| } | ||
|
|
||
| public void setItem(ItemStack item) { | ||
| if (item != null) { | ||
| this.item = item; | ||
| } | ||
| } | ||
|
|
||
| @Override | ||
| public @NotNull ItemStack getItemStack() { | ||
| return getItem(); | ||
| } | ||
|
|
||
| @Override | ||
| public void setItemStack(@NotNull ItemStack stack) { | ||
| setItem(stack); | ||
| } | ||
|
|
||
| public ItemStack getWeapon() { | ||
| return weapon != null ? weapon : item; | ||
| } | ||
|
|
||
| public void setWeapon(ItemStack weapon) { | ||
| this.weapon = weapon; | ||
| } | ||
|
|
||
| public Sound getHitSound() { | ||
| return hitSound; | ||
| } | ||
|
|
||
| public void setHitSound(Sound sound) { | ||
| if (sound != null) { | ||
| this.hitSound = sound; | ||
| } | ||
| } | ||
|
|
||
| public boolean hasNoPhysics() { | ||
| return noPhysics; | ||
| } | ||
|
|
||
| public void setNoPhysics(boolean noPhysics) { | ||
| this.noPhysics = noPhysics; | ||
| } | ||
|
|
||
| public int getLifetimeTicks() { | ||
| return lifetimeTicks; | ||
| } | ||
|
|
||
| public void setLifetimeTicks(int ticks) { | ||
| this.lifetimeTicks = ticks; | ||
| } | ||
|
|
||
| @Override | ||
| public void setShooter(org.bukkit.projectiles.ProjectileSource shooter, boolean update) { | ||
| setShooter(shooter); | ||
| if (update) { | ||
| setHasBeenShot(true); | ||
| } | ||
| } | ||
| } | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.