Skip to content

Commit

Permalink
Update upstream
Browse files Browse the repository at this point in the history
  • Loading branch information
IzzelAliz committed Jan 20, 2024
1 parent d5ab567 commit c2078a9
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -742,17 +742,15 @@ public boolean addPassenger(Entity entity) {
return false;
}
}
// CraftBukkit end
// Spigot start
org.spigotmc.event.entity.EntityMountEvent event = new org.spigotmc.event.entity.EntityMountEvent(((EntityBridge) entity).bridge$getBukkitEntity(), this.getBukkitEntity());
var event = new org.bukkit.event.entity.EntityMountEvent(((EntityBridge) entity).bridge$getBukkitEntity(), this.getBukkitEntity());
// Suppress during worldgen
if (this.valid) {
Bukkit.getPluginManager().callEvent(event);
}
if (event.isCancelled()) {
return false;
}
// Spigot end
// CraftBukkit end
if (this.passengers.isEmpty()) {
this.passengers = ImmutableList.of(entity);
} else {
Expand Down Expand Up @@ -799,17 +797,15 @@ public boolean removePassenger(Entity entity) { // CraftBukkit
return false;
}
}
// CraftBukkit end
// Spigot start
org.spigotmc.event.entity.EntityDismountEvent event = new org.spigotmc.event.entity.EntityDismountEvent(((EntityBridge) entity).bridge$getBukkitEntity(), this.getBukkitEntity());
var event = new org.bukkit.event.entity.EntityDismountEvent(((EntityBridge) entity).bridge$getBukkitEntity(), this.getBukkitEntity());
// Suppress during worldgen
if (this.valid) {
Bukkit.getPluginManager().callEvent(event);
}
if (event.isCancelled()) {
return false;
}
// Spigot end
// CraftBukkit end
if (this.passengers.size() == 1 && this.passengers.get(0) == entity) {
this.passengers = ImmutableList.of();
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import io.izzel.arclight.common.bridge.core.inventory.CraftingInventoryBridge;
import io.izzel.arclight.common.bridge.core.inventory.container.ContainerBridge;
import io.izzel.arclight.common.bridge.core.inventory.container.PosContainerBridge;
import io.izzel.arclight.common.bridge.core.item.crafting.RecipeHolderBridge;
import io.izzel.arclight.common.mod.util.ArclightCaptures;
import net.minecraft.world.Container;
import net.minecraft.world.entity.player.Inventory;
Expand Down Expand Up @@ -62,7 +61,7 @@ public abstract class CraftingMenuMixin extends AbstractContainerMenuMixin imple

@Redirect(method = "slotChangedCraftingGrid", at = @At(value = "INVOKE", remap = false, target = "Ljava/util/Optional;isPresent()Z"))
private static boolean arclight$testRepair(Optional<RecipeHolder<CraftingRecipe>> optional) {
arclight$isRepair = optional.map(it -> ((RecipeHolderBridge) (Object) it).bridge$toBukkitRecipe()).orElse(null) instanceof RepairItemRecipe;
arclight$isRepair = optional.map(RecipeHolder::value).orElse(null) instanceof RepairItemRecipe;
return optional.isPresent();
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
package io.izzel.arclight.common.mixin.core.world.level.block;

import io.izzel.arclight.common.bridge.core.world.WorldBridge;
import net.minecraft.core.BlockPos;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.EntityType;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.CarvedPumpkinBlock;
import net.minecraft.world.level.block.state.pattern.BlockPattern;
import org.bukkit.event.entity.CreatureSpawnEvent;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
Expand All @@ -15,7 +18,8 @@
public class CarvedPumpkinBlockMixin {

@Redirect(method = "spawnGolemInWorld", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/level/block/CarvedPumpkinBlock;clearPatternBlocks(Lnet/minecraft/world/level/Level;Lnet/minecraft/world/level/block/state/pattern/BlockPattern$BlockPatternMatch;)V"))
private static void arclight$clearLater(Level level, BlockPattern.BlockPatternMatch match) {
private static void arclight$clearLater(Level level, BlockPattern.BlockPatternMatch match, Level p_249110_, BlockPattern.BlockPatternMatch p_251293_, Entity entity) {
((WorldBridge) level).bridge$pushAddEntityReason((entity.getType() == EntityType.SNOW_GOLEM) ? CreatureSpawnEvent.SpawnReason.BUILD_SNOWMAN : CreatureSpawnEvent.SpawnReason.BUILD_IRONGOLEM);
}

@Inject(method = "spawnGolemInWorld", cancellable = true, at = @At(value = "INVOKE", shift = At.Shift.AFTER, target = "Lnet/minecraft/world/level/Level;addFreshEntity(Lnet/minecraft/world/entity/Entity;)Z"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ public net.minecraft.network.protocol.game.ClientboundBossEventPacket$UpdateProp
public net.minecraft.network.protocol.game.ClientboundBossEventPacket$UpdateStyleOperation
public net.minecraft.network.protocol.game.ClientboundBossEventPacket$UpdateStyleOperation <init>(Lnet/minecraft/world/BossEvent$BossBarColor;Lnet/minecraft/world/BossEvent$BossBarOverlay;)V # UpdateStyleOperation
public net.minecraft.network.protocol.game.ClientboundBossEventPacket$UpdateStyleOperation <init>(Lnet/minecraft/network/FriendlyByteBuf;)V # UpdateStyleOperation
public net.minecraft.nbt.ListTag <init>(Ljava/util/List;B)V # ListTag
public net.minecraft.world.level.dimension.end.EndDragonFight f_64069_ # previouslyKilled
# Arclight 1.20.2
public net.minecraft.server.network.ServerCommonPacketListenerImpl f_291338_ # connection
public net.minecraft.world.level.levelgen.structure.StructurePiece f_73383_ # boundingBox
Expand Down

0 comments on commit c2078a9

Please sign in to comment.