This commit is contained in:
ZHAY10086
2026-03-17 09:38:29 +08:00
parent b48caab7df
commit 9d084d5cf6
15 changed files with 76 additions and 267 deletions
-36
View File
@@ -1,36 +0,0 @@
#modloaded gendustry
#loader mixin
import native.net.bdew.gendustry.machines.apiary.BlockApiary;
import native.net.bdew.gendustry.machines.apiary.TileApiary;
import native.forestry.api.apiculture.IBeekeepingLogic;
import native.net.minecraft.entity.player.EntityPlayer;
import native.net.minecraft.item.ItemStack;
import native.net.minecraft.util.EnumHand;
import native.net.minecraft.util.text.TextComponentString;
import native.net.minecraft.util.math.BlockPos;
import native.net.minecraft.world.World;
// I hate Scala jars
#mixin {targets: "net.bdew.gendustry.machines.apiary.BlockApiary$"}
zenClass ApiaryBonkMixin {
// SRG HEAD: Block#onBlockClicked -> func_180649_a (not mixin, as inherited)
function func_180649_a(worldIn as World, pos as BlockPos, playerIn as EntityPlayer) as void {
val heldItem as ItemStack = playerIn.getHeldItem(EnumHand.MAIN_HAND);
if (!worldIn.isRemote && heldItem.isEmpty()) {
// Bonk action: refresh apiary
val tile as TileApiary = worldIn.getTileEntity(pos) as TileApiary;
val logic as IBeekeepingLogic = tile.getBeekeepingLogic();
logic.clearCachedValues();
// Chat message
val message as TextComponentString = TextComponentString("§a铛!蜂箱鲜花已更新。");
playerIn.sendStatusMessage(message, true);
}
}
}
-5
View File
@@ -1,5 +0,0 @@
#modloaded gendustry crafttweaker
#loader crafttweaker
// we were supposed to use mixin List getTooltip(ItemStack, World, ITooltipFlag), but Scala is just cursed
<item:gendustry:industrial_apiary>.addTooltip("§3空手敲击蜂箱来更新鲜花!");