Skip to content

Commit

Permalink
Merge branch '1.16' into 1.17
Browse files Browse the repository at this point in the history
  • Loading branch information
Siphalor committed May 27, 2021
2 parents f7d4ac7 + 02ae4cc commit b1c7bff
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 7 deletions.
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ plugins {
id 'fabric-loom' version '0.8-SNAPSHOT'
id 'maven-publish'
id 'com.matthewprenger.cursegradle' version '1.4.0'
id 'com.modrinth.minotaur' version '1.1.0'
id 'com.modrinth.minotaur' version '1.2.1'
id 'org.cadixdev.licenser' version '0.5.0'
}

Expand Down Expand Up @@ -218,7 +218,7 @@ if (project.hasProperty("siphalorModrinthApi")) {
versionName = "[${project.mod_mc_version_specifier}] ${project.mod_version}"
changelog = getProjectChangelog()
uploadFile = remapJar
releaseType = project.mod_release
versionType = project.mod_release
for (version in ((String) project.mod_mc_versions).split(";")) {
addGameVersion(version)
}
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ yarn_build=6:v2
loader_version=0.11.3
# Mod Properties
mod_id=mousewheelie
mod_version=1.7.1
mod_version=1.7.2
mod_release=release
mod_mc_version_specifier=21w19a+
mod_mc_versions=21w19a
Expand Down
22 changes: 18 additions & 4 deletions src/main/java/de/siphalor/mousewheelie/client/MWClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,25 @@ public static boolean performRefill() {
Hand hand = refillHand;
refillHand = null;
if (MWConfig.refill.offHand && hand.equals(Hand.OFF_HAND)) {
InteractionManager.push(new InteractionManager.PacketEvent(new PlayerActionC2SPacket(PlayerActionC2SPacket.Action.SWAP_ITEM_WITH_OFFHAND, BlockPos.ORIGIN, Direction.DOWN), triggerType -> triggerType == InteractionManager.TriggerType.CONTAINER_SLOT_UPDATE && MWClient.lastUpdatedSlot == 45));
// interaction only gets pushed softly so it can be removed if the refill was not successful
InteractionManager.interactionEventQueue.add(
new InteractionManager.PacketEvent(
new PlayerActionC2SPacket(PlayerActionC2SPacket.Action.SWAP_ITEM_WITH_OFFHAND, BlockPos.ORIGIN, Direction.DOWN),
triggerType -> triggerType == InteractionManager.TriggerType.CONTAINER_SLOT_UPDATE && MWClient.lastUpdatedSlot == 45
)
);
}
SlotRefiller.refill();
if (MWConfig.refill.offHand && hand.equals(Hand.OFF_HAND)) {
InteractionManager.push(new InteractionManager.PacketEvent(new PlayerActionC2SPacket(PlayerActionC2SPacket.Action.SWAP_ITEM_WITH_OFFHAND, BlockPos.ORIGIN, Direction.DOWN), triggerType -> triggerType == InteractionManager.TriggerType.CONTAINER_SLOT_UPDATE && MWClient.lastUpdatedSlot == 45));
if (SlotRefiller.refill()) {
if (MWConfig.refill.offHand && hand.equals(Hand.OFF_HAND)) {
InteractionManager.push(
new InteractionManager.PacketEvent(
new PlayerActionC2SPacket(PlayerActionC2SPacket.Action.SWAP_ITEM_WITH_OFFHAND, BlockPos.ORIGIN, Direction.DOWN),
triggerType -> triggerType == InteractionManager.TriggerType.CONTAINER_SLOT_UPDATE && MWClient.lastUpdatedSlot == 45
)
);
}
} else {
InteractionManager.clear();
}

return true;
Expand Down

0 comments on commit b1c7bff

Please sign in to comment.