Skip to content

Commit

Permalink
Fix #1086
Browse files Browse the repository at this point in the history
  • Loading branch information
IThundxr committed Feb 21, 2024
1 parent 7f151a9 commit 3b647d2
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ reach_entity_attributes_version = 2.3.0
registrate_version = 1.1.58-MC1.19.2
milk_lib_version = 1.0.51

port_lib_version = 2.1.1207
port_lib_version = 2.1.1231
# adding a module also requires adding a dependency to the FMJ
port_lib_modules = accessors,base,entity,extensions,fake_players,networking,obj_loader,tags,transfer

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,9 @@

public class SuperGlueHandler {

public static void glueListensForBlockPlacement(BlockPlaceContext context) {
public static void glueListensForBlockPlacement(BlockPlaceContext context, BlockPos pos, BlockState state) {
LevelAccessor world = context.getLevel();
Player entity = context.getPlayer();
BlockPos pos = context.getClickedPos();

if (entity == null || AdventureUtil.isAdventure(entity))
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,13 @@ public class SymmetryHandler {
private static int tickCounter = 0;
private static boolean handlingSymmetry = false; // fabric: prevent infinite recursion in break event listening

public static void onBlockPlaced(BlockPlaceContext context) {
public static void onBlockPlaced(BlockPlaceContext context, BlockPos pos, BlockState state) {
if (context.getLevel()
.isClientSide())
return;

Item held = context.getItemInHand().getItem();
if (!(held instanceof BlockItem block))
if (!(held instanceof BlockItem))
return;

Player player = context.getPlayer();
Expand All @@ -61,7 +61,7 @@ public static void onBlockPlaced(BlockPlaceContext context) {
.isEmpty()
&& inv.getItem(i)
.getItem() == AllItems.WAND_OF_SYMMETRY.get()) {
SymmetryWandItem.apply(player.level, inv.getItem(i), player, context.getClickedPos(), block.getBlock().getStateForPlacement(context));
SymmetryWandItem.apply(player.level, inv.getItem(i), player, pos, state);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -276,8 +276,8 @@ public static void register() {
LivingEntityEvents.DROPS_WITH_LEVEL.register(DeployerFakePlayer::deployerCollectsDropsFromKilledEntities);
LivingEntityEvents.EQUIPMENT_CHANGE.register(NetheriteDivingHandler::onLivingEquipmentChange);
EntityEvents.EYE_HEIGHT.register(DeployerFakePlayer::deployerHasEyesOnHisFeet);
BlockEvents.AFTER_PLACE.register(SymmetryHandler::onBlockPlaced);
BlockEvents.AFTER_PLACE.register(SuperGlueHandler::glueListensForBlockPlacement);
BlockEvents.POST_PROCESS_PLACE.register(SymmetryHandler::onBlockPlaced);
BlockEvents.POST_PROCESS_PLACE.register(SuperGlueHandler::glueListensForBlockPlacement);
ProjectileImpactCallback.EVENT.register(BlazeBurnerHandler::onThrowableImpact);
EntityReadExtraDataCallback.EVENT.register(ExtendoGripItem::addReachToJoiningPlayersHoldingExtendo);
MinecartEvents.SPAWN.register(AbstractMinecartExtensions::minecartSpawn);
Expand Down

0 comments on commit 3b647d2

Please sign in to comment.