fix wrong position check for some items, fix enderpearl no clip
This commit is contained in:
parent
fbed8b8785
commit
7371860654
@ -1,3 +1,8 @@
|
||||
Flan 1.4.2
|
||||
======================
|
||||
- Fix some items checking for wrong position and thus are able to interact in claims
|
||||
- Fix enderpearl phasing through blocks
|
||||
|
||||
Flan 1.4.2
|
||||
======================
|
||||
- Fix a ticking player crash
|
||||
|
@ -148,6 +148,8 @@ public class EntityInteractEvents {
|
||||
pers.setShotFromCrossbow(false);
|
||||
((IPersistentProjectileVars) pers).resetPiercingStatus();
|
||||
}
|
||||
if(proj instanceof EnderPearlEntity)
|
||||
proj.remove();
|
||||
//TODO: find a way to properly update chorus fruit break on hit
|
||||
//player.getServer().send(new ServerTask(player.getServer().getTicks()+2, ()->player.world.updateListeners(pos, state, state, 2)));
|
||||
}
|
||||
|
@ -11,6 +11,7 @@ import io.github.flemmli97.flan.claim.ObjectToPermissionMap;
|
||||
import io.github.flemmli97.flan.claim.PermHelper;
|
||||
import io.github.flemmli97.flan.config.ConfigHandler;
|
||||
import io.github.flemmli97.flan.integration.permissionapi.CommandPermission;
|
||||
import io.github.flemmli97.flan.mixin.IItemAccessor;
|
||||
import io.github.flemmli97.flan.player.EnumDisplayType;
|
||||
import io.github.flemmli97.flan.player.EnumEditMode;
|
||||
import io.github.flemmli97.flan.player.PlayerClaimData;
|
||||
@ -65,6 +66,10 @@ public class ItemInteractEvents {
|
||||
|
||||
ClaimStorage storage = ClaimStorage.get((ServerWorld) world);
|
||||
BlockPos pos = player.getBlockPos();
|
||||
HitResult hitResult = IItemAccessor.getRaycast(world, player, RaycastContext.FluidHandling.SOURCE_ONLY);
|
||||
if (hitResult.getType() == HitResult.Type.BLOCK) {
|
||||
pos = new ItemPlacementContext(player, hand, stack, (BlockHitResult) hitResult).getBlockPos();
|
||||
}
|
||||
IPermissionContainer claim = storage.getForPermissionCheck(pos);
|
||||
if (claim == null)
|
||||
return TypedActionResult.pass(stack);
|
||||
|
@ -0,0 +1,18 @@
|
||||
package io.github.flemmli97.flan.mixin;
|
||||
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.util.hit.BlockHitResult;
|
||||
import net.minecraft.world.RaycastContext;
|
||||
import net.minecraft.world.World;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.gen.Invoker;
|
||||
|
||||
@Mixin(Item.class)
|
||||
public interface IItemAccessor {
|
||||
|
||||
@Invoker("raycast")
|
||||
static BlockHitResult getRaycast(World world, PlayerEntity player, RaycastContext.FluidHandling fluidHandling) {
|
||||
throw new IllegalStateException();
|
||||
}
|
||||
}
|
@ -18,7 +18,8 @@
|
||||
"PlayerMixin",
|
||||
"ItemEntityMixin",
|
||||
"EndermanPickupMixin",
|
||||
"EndermanPlaceMixin"
|
||||
"EndermanPlaceMixin",
|
||||
"IItemAccessor"
|
||||
],
|
||||
"server": [
|
||||
],
|
||||
|
Loading…
Reference in New Issue
Block a user