Update upstream
This commit is contained in:
parent
6bfebdb9d7
commit
f7bf687d4e
|
@ -0,0 +1,8 @@
|
||||||
|
package io.izzel.arclight.common.bridge.core.block;
|
||||||
|
|
||||||
|
import net.minecraft.world.level.Level;
|
||||||
|
|
||||||
|
public interface SculkSpreaderBridge {
|
||||||
|
|
||||||
|
void bridge$setLevel(Level level);
|
||||||
|
}
|
|
@ -0,0 +1,8 @@
|
||||||
|
package io.izzel.arclight.common.bridge.core.tileentity;
|
||||||
|
|
||||||
|
import net.minecraft.world.level.Level;
|
||||||
|
|
||||||
|
public interface SculkCatalystListenerBridge {
|
||||||
|
|
||||||
|
void bridge$setLevel(Level level);
|
||||||
|
}
|
|
@ -0,0 +1,41 @@
|
||||||
|
package io.izzel.arclight.common.mixin.core.world.level.block;
|
||||||
|
|
||||||
|
import io.izzel.arclight.common.bridge.core.block.SculkSpreaderBridge;
|
||||||
|
import net.minecraft.world.level.Level;
|
||||||
|
import net.minecraft.world.level.block.SculkSpreader;
|
||||||
|
import org.bukkit.Bukkit;
|
||||||
|
import org.bukkit.craftbukkit.v.block.CraftBlock;
|
||||||
|
import org.bukkit.event.block.SculkBloomEvent;
|
||||||
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.Shadow;
|
||||||
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
|
import org.spongepowered.asm.mixin.injection.Inject;
|
||||||
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||||
|
|
||||||
|
@Mixin(SculkSpreader.class)
|
||||||
|
public abstract class SculkSpreaderMixin implements SculkSpreaderBridge {
|
||||||
|
|
||||||
|
// @formatter:off
|
||||||
|
@Shadow public abstract boolean isWorldGeneration();
|
||||||
|
// @formatter:on
|
||||||
|
|
||||||
|
private transient Level arclight$level;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void bridge$setLevel(Level level) {
|
||||||
|
this.arclight$level = level;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Inject(method = "addCursor", cancellable = true, at = @At(value = "INVOKE", remap = false, target = "Ljava/util/List;add(Ljava/lang/Object;)Z"))
|
||||||
|
private void arclight$bloomEvent(SculkSpreader.ChargeCursor cursor, CallbackInfo ci) {
|
||||||
|
if (!isWorldGeneration() && arclight$level != null) {
|
||||||
|
var bukkitBlock = CraftBlock.at(arclight$level, cursor.pos);
|
||||||
|
var event = new SculkBloomEvent(bukkitBlock, cursor.getCharge());
|
||||||
|
Bukkit.getPluginManager().callEvent(event);
|
||||||
|
if (event.isCancelled()) {
|
||||||
|
ci.cancel();
|
||||||
|
}
|
||||||
|
cursor.charge = event.getCharge();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -37,6 +37,7 @@ public abstract class BlockEntityMixin implements TileEntityBridge {
|
||||||
@Shadow protected static void setChanged(Level p_155233_, BlockPos p_155234_, BlockState p_155235_) { }
|
@Shadow protected static void setChanged(Level p_155233_, BlockPos p_155234_, BlockState p_155235_) { }
|
||||||
@Shadow public abstract BlockEntityType<?> getType();
|
@Shadow public abstract BlockEntityType<?> getType();
|
||||||
@Shadow public void load(CompoundTag p_155245_) {}
|
@Shadow public void load(CompoundTag p_155245_) {}
|
||||||
|
@Shadow public void setLevel(Level p_155231_) {}
|
||||||
// @formatter:on
|
// @formatter:on
|
||||||
|
|
||||||
@Inject(method = "load", at = @At("RETURN"))
|
@Inject(method = "load", at = @At("RETURN"))
|
||||||
|
|
|
@ -1,12 +1,15 @@
|
||||||
package io.izzel.arclight.common.mixin.core.world.level.block.entity;
|
package io.izzel.arclight.common.mixin.core.world.level.block.entity;
|
||||||
|
|
||||||
|
import io.izzel.arclight.common.bridge.core.tileentity.SculkCatalystListenerBridge;
|
||||||
import net.minecraft.core.BlockPos;
|
import net.minecraft.core.BlockPos;
|
||||||
import net.minecraft.nbt.CompoundTag;
|
import net.minecraft.nbt.CompoundTag;
|
||||||
import net.minecraft.world.level.Level;
|
import net.minecraft.world.level.Level;
|
||||||
import net.minecraft.world.level.block.entity.SculkCatalystBlockEntity;
|
import net.minecraft.world.level.block.entity.SculkCatalystBlockEntity;
|
||||||
import net.minecraft.world.level.block.state.BlockState;
|
import net.minecraft.world.level.block.state.BlockState;
|
||||||
import org.bukkit.craftbukkit.v.event.CraftEventFactory;
|
import org.bukkit.craftbukkit.v.event.CraftEventFactory;
|
||||||
|
import org.spongepowered.asm.mixin.Final;
|
||||||
import org.spongepowered.asm.mixin.Mixin;
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.Shadow;
|
||||||
import org.spongepowered.asm.mixin.injection.At;
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
import org.spongepowered.asm.mixin.injection.Inject;
|
import org.spongepowered.asm.mixin.injection.Inject;
|
||||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||||
|
@ -14,6 +17,14 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||||
@Mixin(SculkCatalystBlockEntity.class)
|
@Mixin(SculkCatalystBlockEntity.class)
|
||||||
public abstract class SculkCatalystBlockEntityMixin extends BlockEntityMixin {
|
public abstract class SculkCatalystBlockEntityMixin extends BlockEntityMixin {
|
||||||
|
|
||||||
|
@Shadow @Final private SculkCatalystBlockEntity.CatalystListener catalystListener;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setLevel(Level p_155231_) {
|
||||||
|
super.setLevel(p_155231_);
|
||||||
|
((SculkCatalystListenerBridge) this.catalystListener).bridge$setLevel(p_155231_);
|
||||||
|
}
|
||||||
|
|
||||||
@Inject(method = "serverTick", at = @At("HEAD"))
|
@Inject(method = "serverTick", at = @At("HEAD"))
|
||||||
private static void arclight$overrideSource(Level p_222780_, BlockPos p_222781_, BlockState p_222782_, SculkCatalystBlockEntity blockEntity, CallbackInfo ci) {
|
private static void arclight$overrideSource(Level p_222780_, BlockPos p_222781_, BlockState p_222782_, SculkCatalystBlockEntity blockEntity, CallbackInfo ci) {
|
||||||
CraftEventFactory.sourceBlockOverride = blockEntity.getBlockPos();
|
CraftEventFactory.sourceBlockOverride = blockEntity.getBlockPos();
|
||||||
|
|
|
@ -0,0 +1,21 @@
|
||||||
|
package io.izzel.arclight.common.mixin.core.world.level.block.entity;
|
||||||
|
|
||||||
|
import io.izzel.arclight.common.bridge.core.block.SculkSpreaderBridge;
|
||||||
|
import io.izzel.arclight.common.bridge.core.tileentity.SculkCatalystListenerBridge;
|
||||||
|
import net.minecraft.world.level.Level;
|
||||||
|
import net.minecraft.world.level.block.SculkSpreader;
|
||||||
|
import net.minecraft.world.level.block.entity.SculkCatalystBlockEntity;
|
||||||
|
import org.spongepowered.asm.mixin.Final;
|
||||||
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.Shadow;
|
||||||
|
|
||||||
|
@Mixin(SculkCatalystBlockEntity.CatalystListener.class)
|
||||||
|
public class SculkCatalystBlockEntity_CatalystListenerMixin implements SculkCatalystListenerBridge {
|
||||||
|
|
||||||
|
@Shadow @Final SculkSpreader sculkSpreader;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void bridge$setLevel(Level level) {
|
||||||
|
((SculkSpreaderBridge) this.sculkSpreader).bridge$setLevel(level);
|
||||||
|
}
|
||||||
|
}
|
|
@ -4,6 +4,9 @@ public net.minecraft.server.dedicated.DedicatedServerProperties$WorldDimensionDa
|
||||||
public net.minecraft.world.entity.projectile.Arrow f_36855_ # potion
|
public net.minecraft.world.entity.projectile.Arrow f_36855_ # potion
|
||||||
public net.minecraft.world.entity.Display$TextDisplay f_268476_ # DATA_LINE_WIDTH_ID
|
public net.minecraft.world.entity.Display$TextDisplay f_268476_ # DATA_LINE_WIDTH_ID
|
||||||
public net.minecraft.world.entity.Display$TextDisplay f_268494_ # DATA_BACKGROUND_COLOR_ID
|
public net.minecraft.world.entity.Display$TextDisplay f_268494_ # DATA_BACKGROUND_COLOR_ID
|
||||||
|
public net.minecraft.world.level.block.entity.SculkCatalystBlockEntity$CatalystListener m_280309_(Lnet/minecraft/server/level/ServerLevel;Lnet/minecraft/core/BlockPos;Lnet/minecraft/world/level/block/state/BlockState;Lnet/minecraft/util/RandomSource;)V # bloom
|
||||||
|
public net.minecraft.world.level.block.SculkSpreader$ChargeCursor f_222288_ # pos
|
||||||
|
public net.minecraft.world.level.block.SculkSpreader$ChargeCursor f_222289_ # charge
|
||||||
# Arclight 1.19.4
|
# Arclight 1.19.4
|
||||||
public net.minecraft.world.item.DebugStickItem m_150802_(Lnet/minecraft/world/entity/player/Player;Lnet/minecraft/world/level/block/state/BlockState;Lnet/minecraft/world/level/LevelAccessor;Lnet/minecraft/core/BlockPos;ZLnet/minecraft/world/item/ItemStack;)Z # handleInteraction
|
public net.minecraft.world.item.DebugStickItem m_150802_(Lnet/minecraft/world/entity/player/Player;Lnet/minecraft/world/level/block/state/BlockState;Lnet/minecraft/world/level/LevelAccessor;Lnet/minecraft/core/BlockPos;ZLnet/minecraft/world/item/ItemStack;)Z # handleInteraction
|
||||||
public net.minecraft.world.level.block.ComposterBlock m_269590_(Lnet/minecraft/world/entity/Entity;Lnet/minecraft/world/level/block/state/BlockState;Lnet/minecraft/world/level/LevelAccessor;Lnet/minecraft/core/BlockPos;)Lnet/minecraft/world/level/block/state/BlockState; # empty
|
public net.minecraft.world.level.block.ComposterBlock m_269590_(Lnet/minecraft/world/entity/Entity;Lnet/minecraft/world/level/block/state/BlockState;Lnet/minecraft/world/level/LevelAccessor;Lnet/minecraft/core/BlockPos;)Lnet/minecraft/world/level/block/state/BlockState; # empty
|
||||||
|
|
|
@ -417,6 +417,7 @@
|
||||||
"world.level.block.SculkBlockMixin",
|
"world.level.block.SculkBlockMixin",
|
||||||
"world.level.block.SculkSensorBlockMixin",
|
"world.level.block.SculkSensorBlockMixin",
|
||||||
"world.level.block.SculkShriekerBlockMixin",
|
"world.level.block.SculkShriekerBlockMixin",
|
||||||
|
"world.level.block.SculkSpreaderMixin",
|
||||||
"world.level.block.SculkVeinBlockMixin",
|
"world.level.block.SculkVeinBlockMixin",
|
||||||
"world.level.block.SignBlockMixin",
|
"world.level.block.SignBlockMixin",
|
||||||
"world.level.block.SnowBlockMixin",
|
"world.level.block.SnowBlockMixin",
|
||||||
|
@ -457,6 +458,7 @@
|
||||||
"world.level.block.entity.LecternBlockEntityMixin",
|
"world.level.block.entity.LecternBlockEntityMixin",
|
||||||
"world.level.block.entity.LecternTileEntity1Mixin",
|
"world.level.block.entity.LecternTileEntity1Mixin",
|
||||||
"world.level.block.entity.LockableBlockEntityMixin",
|
"world.level.block.entity.LockableBlockEntityMixin",
|
||||||
|
"world.level.block.entity.SculkCatalystBlockEntity_CatalystListenerMixin",
|
||||||
"world.level.block.entity.SculkCatalystBlockEntityMixin",
|
"world.level.block.entity.SculkCatalystBlockEntityMixin",
|
||||||
"world.level.block.entity.ShulkerBoxBlockEntityMixin",
|
"world.level.block.entity.ShulkerBoxBlockEntityMixin",
|
||||||
"world.level.block.entity.SignBlockEntityMixin",
|
"world.level.block.entity.SignBlockEntityMixin",
|
||||||
|
|
Loading…
Reference in New Issue
Block a user