1.15 adjustments for scarpet 1.5

This commit is contained in:
gnembon committed 2019-10-08 02:18:09 -03:00
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);
}
@Shadow protected abstract void method_6040();
@Shadow protected abstract void consumeItem();
@Redirect(method = "method_6040", at = @At(
@Redirect(method = "consumeItem", at = @At(
value = "INVOKE",
target = "Lnet/minecraft/entity/player/PlayerEntity;method_6040()V"
target = "Lnet/minecraft/entity/player/PlayerEntity;consumeItem()V"
))
private void finishedUsingItem(PlayerEntity playerEntity)
{
@@ -34,13 +34,13 @@ public abstract class ServerPlayerEntity_scarpetEventMixin extends PlayerEntity
Hand hand = getActiveHand();
ItemStack stack = getActiveItem().copy();
// do vanilla
super.method_6040();
super.consumeItem();
PLAYER_FINISHED_USING_ITEM.onItemAction((ServerPlayerEntity) (Object)this, hand, stack);
}
else
{
// do vanilla
super.method_6040();
super.consumeItem();
}
}
}
@@ -294,7 +294,7 @@ public class NBTSerializableValue extends Value implements ContainerValueInterfa
Collection<Tag> targets;
try
{
targets = nbtPath.putIfAbsent(currentTag, ListTag::new);
targets = nbtPath.getOrInit(currentTag, ListTag::new);
}
catch (CommandSyntaxException e)
{
@@ -332,7 +332,7 @@ public class NBTSerializableValue extends Value implements ContainerValueInterfa
Tag originalTag = getTag().copy();
try
{
for (Tag target : nbtPath.putIfAbsent(originalTag, CompoundTag::new))
for (Tag target : nbtPath.getOrInit(originalTag, CompoundTag::new))
{
if (!(target instanceof CompoundTag))
{