1.15 adjustments for scarpet 1.5
This commit is contained in:
1 parent
dc9532cf05
commit
03703fd7fe
2 files changed
+7
-7
No files matched your search
@@ -21,11 +21,11 @@ public abstract class ServerPlayerEntity_scarpetEventMixin extends PlayerEntity
|
|||||||
super(world_1, gameProfile_1);
|
super(world_1, gameProfile_1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Shadow protected abstract void method_6040();
|
@Shadow protected abstract void consumeItem();
|
||||||
|
|
||||||
@Redirect(method = "method_6040", at = @At(
|
@Redirect(method = "consumeItem", at = @At(
|
||||||
value = "INVOKE",
|
value = "INVOKE",
|
||||||
target = "Lnet/minecraft/entity/player/PlayerEntity;method_6040()V"
|
target = "Lnet/minecraft/entity/player/PlayerEntity;consumeItem()V"
|
||||||
))
|
))
|
||||||
private void finishedUsingItem(PlayerEntity playerEntity)
|
private void finishedUsingItem(PlayerEntity playerEntity)
|
||||||
{
|
{
|
||||||
@@ -34,13 +34,13 @@ public abstract class ServerPlayerEntity_scarpetEventMixin extends PlayerEntity
|
|||||||
Hand hand = getActiveHand();
|
Hand hand = getActiveHand();
|
||||||
ItemStack stack = getActiveItem().copy();
|
ItemStack stack = getActiveItem().copy();
|
||||||
// do vanilla
|
// do vanilla
|
||||||
super.method_6040();
|
super.consumeItem();
|
||||||
PLAYER_FINISHED_USING_ITEM.onItemAction((ServerPlayerEntity) (Object)this, hand, stack);
|
PLAYER_FINISHED_USING_ITEM.onItemAction((ServerPlayerEntity) (Object)this, hand, stack);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// do vanilla
|
// do vanilla
|
||||||
super.method_6040();
|
super.consumeItem();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -294,7 +294,7 @@ public class NBTSerializableValue extends Value implements ContainerValueInterfa
|
|||||||
Collection<Tag> targets;
|
Collection<Tag> targets;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
targets = nbtPath.putIfAbsent(currentTag, ListTag::new);
|
targets = nbtPath.getOrInit(currentTag, ListTag::new);
|
||||||
}
|
}
|
||||||
catch (CommandSyntaxException e)
|
catch (CommandSyntaxException e)
|
||||||
{
|
{
|
||||||
@@ -332,7 +332,7 @@ public class NBTSerializableValue extends Value implements ContainerValueInterfa
|
|||||||
Tag originalTag = getTag().copy();
|
Tag originalTag = getTag().copy();
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
for (Tag target : nbtPath.putIfAbsent(originalTag, CompoundTag::new))
|
for (Tag target : nbtPath.getOrInit(originalTag, CompoundTag::new))
|
||||||
{
|
{
|
||||||
if (!(target instanceof CompoundTag))
|
if (!(target instanceof CompoundTag))
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in new issue
Block a user