Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

this is why docs are important #6

Merged
merged 1 commit into from
Jul 27, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions src/main/java/juuxel/bee/client/BeeAngryestClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ public void onInitializeClient() {

HudRenderCallback.EVENT.register((matrices, tickDelta) -> {
MinecraftClient mc = MinecraftClient.getInstance();
if (mc.player == null) return;
if (mc.targetedEntity instanceof BeeEntity) {
boolean hasScoop = mc.player.getMainHandStack().getItem() instanceof ScoopItem || mc.player.getOffHandStack().getItem() instanceof ScoopItem;
if (mc.player == null) return;
boolean hasScoop = ScoopItem.hasScoop(mc.player);
if (hasScoop) {
Text message = new TranslatableText("gui.beeangry-est.hud.catch");
Text name = mc.targetedEntity.getDisplayName();
Expand All @@ -50,8 +50,11 @@ public void onInitializeClient() {

int x = window.getScaledWidth() / 2 - 2;
int y = window.getScaledHeight() / 2 + 16;
font.drawWithShadow(matrices, message, x + 4.5f, y, 0xFFFFFF);
font.drawWithShadow(matrices, name, x + font.getWidth(name)/2, y+8, 0xFFFFFF);
int mw = font.getWidth(message);
int nw = font.getWidth(name);
int offset = mw>nw ? mw/8 : nw/8;
font.drawWithShadow(matrices, message, x + offset, y, 0xFFFFFF);
font.drawWithShadow(matrices, name, x + offset, y+8, 0xFFFFFF);

useLabelRenderer.render(matrices, mc, font, x, y);
}
Expand Down
6 changes: 5 additions & 1 deletion src/main/java/juuxel/bee/client/BeeLambdaControlsCompat.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,18 @@
import me.lambdaurora.lambdacontrols.client.LambdaControlsClient;
import me.lambdaurora.lambdacontrols.client.compat.CompatHandler;
import me.lambdaurora.lambdacontrols.client.compat.LambdaControlsCompat;
import me.lambdaurora.lambdacontrols.client.controller.ButtonBinding;
import me.lambdaurora.lambdacontrols.client.gui.LambdaControlsRenderer;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.minecraft.client.MinecraftClient;
import net.minecraft.entity.passive.BeeEntity;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.util.hit.BlockHitResult;

import javax.annotation.Nullable;

@Environment(EnvType.CLIENT)
enum BeeLambdaControlsCompat implements CompatHandler {
INSTANCE;

Expand All @@ -21,7 +25,7 @@ enum BeeLambdaControlsCompat implements CompatHandler {
static void init() {
BeeAngryestClient.useLabelRenderer = (matrices, mc, font, x, y) -> {
if (INSTANCE.lambdaControls.config.getControlsMode() == ControlsMode.CONTROLLER) {
LambdaControlsRenderer.drawButton(matrices, x - 17, y - 3, 104, mc);
LambdaControlsRenderer.drawButton(matrices, x - 17, y - 3, ButtonBinding.USE, mc);
} else {
BeeAngryestClient.renderUseLabel(matrices, mc, font, x, y);
}
Expand Down
Binary file modified src/main/resources/assets/beeangry-est/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/main/resources/assets/beeangry-est/textures/item/scoop.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.