Skip to content

Commit

Permalink
Now pressing buttons gives you a ding
Browse files Browse the repository at this point in the history
  • Loading branch information
MrFrydae committed Feb 16, 2021
1 parent 0a0fc98 commit 4ab6164
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ org.gradle.jvmargs=-Xmx1G
loader_version=0.11.1

# Mod Properties
mod_version = 1.1.0
mod_version = 1.1.1
maven_group = coffee.waffle
archives_base_name = empire-minecraft-utilities

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.network.packet.s2c.play.GameJoinS2CPacket;
import net.minecraft.network.packet.s2c.play.GameMessageS2CPacket;
import net.minecraft.sound.SoundEvent;
import net.minecraft.sound.SoundEvents;
import net.minecraft.text.LiteralText;
import net.minecraft.util.Formatting;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
Expand Down Expand Up @@ -65,11 +67,16 @@ public static void handleChatScreenRender(Screen screen, MatrixStack matrices, C
public static void handleChatScreenMouseClicked(Screen screen, double mouseX, double mouseY, int button, CallbackInfoReturnable<Boolean> cir) {
if (Util.IS_ON_EMC) {
for (ChatChannel channel : ChatChannel.values()) {
if (channel == ChatChannel.SUPPORTER && Util.playerGroupId < 2) break;
if (channel == ChatChannel.MODERATOR && Util.playerGroupId < 5) break;

if (isInBounds(screen, channel.name, channel.getOffset(), mouseX, mouseY) && (System.currentTimeMillis() - lastClickedButtonTime) >= 1000L && currentChannel != channel) {
lastClickedButtonTime = System.currentTimeMillis();
currentChannel = channel;
channel.executeCommand();

MinecraftClient.getInstance().player.playSound(SoundEvents.BLOCK_NOTE_BLOCK_PLING, 5, 5);

// Cancel private conversation if in one
inPrivateConversation = false;

Expand Down

0 comments on commit 4ab6164

Please sign in to comment.