move pickup check to a better place
This commit is contained in:
parent
83acb77647
commit
c87b1e4005
@ -1,3 +1,7 @@
|
||||
Flan 1.7.9
|
||||
================
|
||||
- Move pickup check to a better place. Should fix some mod compat issues
|
||||
|
||||
Flan 1.7.8
|
||||
================
|
||||
- Add dynmap support for claims
|
||||
|
@ -1,5 +1,6 @@
|
||||
package io.github.flemmli97.flan.mixin;
|
||||
|
||||
import io.github.flemmli97.flan.event.EntityInteractEvents;
|
||||
import io.github.flemmli97.flan.player.IOwnedItem;
|
||||
import io.github.flemmli97.flan.player.PlayerClaimData;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
@ -41,6 +42,13 @@ public abstract class ItemEntityMixin implements IOwnedItem {
|
||||
this.flanDeathPlayerOrigin = this.flanPlayerOrigin;
|
||||
}
|
||||
|
||||
@Inject(method = "playerTouch", at = @At(value = "HEAD"), cancellable = true)
|
||||
private void pickup(Player player, CallbackInfo info) {
|
||||
if (!EntityInteractEvents.canCollideWith(player, (ItemEntity) (Object) this)) {
|
||||
info.cancel();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public UUID getDeathPlayer() {
|
||||
return this.flanDeathPlayerOrigin;
|
||||
|
@ -1,14 +1,11 @@
|
||||
package io.github.flemmli97.flan.mixin;
|
||||
|
||||
import io.github.flemmli97.flan.event.EntityInteractEvents;
|
||||
import net.minecraft.world.entity.Entity;
|
||||
import net.minecraft.world.entity.item.ItemEntity;
|
||||
import net.minecraft.world.entity.player.Player;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.ModifyVariable;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
|
||||
@Mixin(Player.class)
|
||||
public abstract class PlayerMixin {
|
||||
@ -18,12 +15,4 @@ public abstract class PlayerMixin {
|
||||
EntityInteractEvents.updateDroppedItem((Player) (Object) this, entity);
|
||||
return entity;
|
||||
}
|
||||
|
||||
@Inject(method = "touch", at = @At(value = "HEAD"), cancellable = true)
|
||||
private void entityCollide(Entity entity, CallbackInfo info) {
|
||||
if (!EntityInteractEvents.canCollideWith((Player) (Object) this, entity)) {
|
||||
info.cancel();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -11,7 +11,7 @@ forge_version=1.18.2-40.0.3
|
||||
loader_version=0.13.2
|
||||
|
||||
# Mod Properties
|
||||
mod_version=1.7.8
|
||||
mod_version=1.7.9
|
||||
maven_group=io.github.flemmli97
|
||||
archives_base_name=flan
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user