mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-21 15:54:45 +01:00
SPIGOT-7736: Creative spawn egg use loses components
By: md_5 <git@md-5.net>
This commit is contained in:
parent
9db084c279
commit
b365899587
1 changed files with 2 additions and 2 deletions
|
@ -103,7 +103,7 @@
|
||||||
Item item = this.getItem();
|
Item item = this.getItem();
|
||||||
- EnumInteractionResult enuminteractionresult = item.useOn(itemactioncontext);
|
- EnumInteractionResult enuminteractionresult = item.useOn(itemactioncontext);
|
||||||
+ // CraftBukkit start - handle all block place event logic here
|
+ // CraftBukkit start - handle all block place event logic here
|
||||||
+ DataComponentPatch oldData = this.getComponentsPatch();
|
+ DataComponentPatch oldData = this.components.asPatch();
|
||||||
+ int oldCount = this.getCount();
|
+ int oldCount = this.getCount();
|
||||||
+ WorldServer world = (WorldServer) itemactioncontext.getLevel();
|
+ WorldServer world = (WorldServer) itemactioncontext.getLevel();
|
||||||
+
|
+
|
||||||
|
@ -120,7 +120,7 @@
|
||||||
+ } finally {
|
+ } finally {
|
||||||
+ world.captureBlockStates = false;
|
+ world.captureBlockStates = false;
|
||||||
+ }
|
+ }
|
||||||
+ DataComponentPatch newData = this.getComponentsPatch();
|
+ DataComponentPatch newData = this.components.asPatch();
|
||||||
+ int newCount = this.getCount();
|
+ int newCount = this.getCount();
|
||||||
+ this.setCount(oldCount);
|
+ this.setCount(oldCount);
|
||||||
+ this.restorePatch(oldData);
|
+ this.restorePatch(oldData);
|
||||||
|
|
Loading…
Add table
Reference in a new issue