Skip to content

Commit

Permalink
Fix entity colliding. (Closes #1468)
Browse files Browse the repository at this point in the history
Signed-off-by: 秋雨落 <[email protected]>
  • Loading branch information
qyl27 committed Sep 20, 2024
1 parent 90ea5f9 commit 4610d2b
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 34 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,6 @@ public interface EntityBridge extends ICommandSourceBridge, InjectEntityBridge {

int bridge$getRideCooldown();

boolean bridge$canCollideWith(Entity entity);

void bridge$setLastLavaContact(BlockPos pos);

void bridge$revive();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -592,15 +592,6 @@ public void setSecondsOnFire(float seconds, boolean callEvent) {
this.level().getChunk((int) Math.floor(this.getX()) >> 4, (int) Math.floor(this.getZ()) >> 4);
}

public boolean canCollideWith(Entity entity) {
return this.isPushable();
}

@Override
public boolean bridge$canCollideWith(Entity entity) {
return canCollideWith(entity);
}

@Unique protected transient boolean arclight$saveNotIncludeAll = false;

protected void addAdditionalSaveData(CompoundTag tag, boolean includeAll) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -828,20 +828,6 @@ public boolean isPickable() {
return !this.isRemoved() && this.collides;
}

/**
* @author IzzrlAliz
* @reason
*/
@Overwrite
public boolean isPushable() {
return this.isAlive() && !this.onClimbable() && this.collides;
}

@Override
public boolean canCollideWith(Entity entity) {
return this.isPushable() && this.collides != this.collidableExemptions.contains(entity.getUUID());
}

@Decorate(method = "completeUsingItem", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/item/ItemStack;finishUsingItem(Lnet/minecraft/world/level/Level;Lnet/minecraft/world/entity/LivingEntity;)Lnet/minecraft/world/item/ItemStack;"))
private ItemStack arclight$itemConsume(ItemStack itemStack, Level worldIn, LivingEntity entityLiving) throws
Throwable {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,6 @@ public abstract class ParrotMixin extends AnimalMixin {
private void arclight$handledInSuper(Parrot parrotEntity, boolean p_233687_1_) {
}

/**
* @author IzzelAliz
* @reason
*/
@Overwrite
public boolean isPushable() {
return super.isPushable(); // CraftBukkit - collidable API
}

@Redirect(method = "mobInteract", at = @At(value = "INVOKE", target = "Lnet/minecraft/util/RandomSource;nextInt(I)I"))
private int arclight$tame(RandomSource instance, int i, Player player) {
var ret = instance.nextInt(i);
Expand Down

0 comments on commit 4610d2b

Please sign in to comment.