Skip to content

Commit

Permalink
Set remap to true
Browse files Browse the repository at this point in the history
  • Loading branch information
yuesha-yc committed Dec 12, 2024
1 parent 1b5dcf8 commit 9509dc5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -1,31 +1,29 @@
package com.teammoeg.frostedheart.mixin.noremap;
package com.teammoeg.frostedheart.mixin.caupona;

import blusunrize.immersiveengineering.common.blocks.plant.HempBlock;
import com.teammoeg.caupona.blocks.plants.FruitsLeavesBlock;
import com.teammoeg.caupona.blocks.plants.SilphiumBlock;
import com.teammoeg.frostedheart.base.event.PerformBonemealEvent;
import com.teammoeg.frostedheart.content.climate.WorldTemperature;
import net.minecraft.core.BlockPos;
import net.minecraft.server.level.ServerLevel;
import net.minecraft.util.RandomSource;
import net.minecraft.world.level.LevelReader;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraftforge.common.MinecraftForge;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;

@Mixin(value = {
SilphiumBlock.class, FruitsLeavesBlock.class
})
public class NonvanillaBonemealableBlockMixin_CheckTemp {
public class CauponaBonemealableBlockMixin_CheckTemp {
/**
* @reason Check if the block can be bonemealed
* @author yuesha-yc
*
* Note: Must set remap to be true as this performBonemeal is from minecraft interface.
*/
@Inject(method = "performBonemeal", at = @At("HEAD"), cancellable = true, remap = false)
@Inject(method = "performBonemeal", at = @At("HEAD"), cancellable = true)
private void fh$checkTempForBonemeal(ServerLevel pLevel, RandomSource pRandom, BlockPos pPos, BlockState pState, CallbackInfo ci) {
if (MinecraftForge.EVENT_BUS.post(new PerformBonemealEvent(pLevel, pPos, pState, pRandom))) {
ci.cancel();
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/frostedheart.mixins.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
"minecraft.temperature.SnowLayerBlockMixin_Melt",
"minecraft.research.BlockEntityMixin_Research",
"minecraft.temperature.VillagerMixin",
"noremap.NonvanillaBonemealableBlockMixin_CheckTemp"
"caupona.CauponaBonemealableBlockMixin_CheckTemp"
],
"client": [
"client.BossHealthOverlayAccess",
Expand Down

0 comments on commit 9509dc5

Please sign in to comment.