Skip to content

Commit

Permalink
1.21.2-pre3
Browse files Browse the repository at this point in the history
  • Loading branch information
AzureAaron committed Oct 21, 2024
1 parent 47d0444 commit 6bcf1db
Show file tree
Hide file tree
Showing 114 changed files with 1,382 additions and 435 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id 'fabric-loom' version '1.7-SNAPSHOT'
id 'fabric-loom' version '1.8-SNAPSHOT'
id 'maven-publish'
id "me.modmuss50.mod-publish-plugin" version "0.7.2"
id "de.hysky.skyblocker.annotation-processor"
Expand Down
16 changes: 8 additions & 8 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,22 @@ org.gradle.jvmargs=-Xmx1G -Dfile.encoding=UTF-8 -Duser.language=en -Duser.countr
org.gradle.parallel=true

# Fabric Properties (https://fabricmc.net/versions.html)
## 1.21.1
minecraft_version=1.21.1
yarn_mappings=1.21.1+build.3
loader_version=0.15.11
## 1.21.2
minecraft_version=1.21.2-pre3
yarn_mappings=1.21.2-pre3+build.3
loader_version=0.16.7

#Fabric api
## 1.21.1
fabric_api_version=0.102.1+1.21.1
## 1.21.2
fabric_api_version=0.106.0+1.21.2

# Minecraft Mods
## YACL (https://github.com/isXander/YetAnotherConfigLib)
yacl_version=3.5.0+1.21
## HM API (https://github.com/AzureAaron/hm-api)
hm_api_version=1.0.1+1.21.1
## Mod Menu (https://modrinth.com/mod/modmenu/versions)
mod_menu_version = 11.0.0-beta.1
mod_menu_version = 12.0.0-beta.1
## REI (https://modrinth.com/mod/rei/versions?l=fabric)
rei_version = 13.0.666
## EMI (https://modrinth.com/mod/emi/versions)
Expand All @@ -39,7 +39,7 @@ legacy_item_dfu_version = 1.0.1+1.21.1

# Other Libraries
## JGit (https://mvnrepository.com/artifact/org.eclipse.jgit/org.eclipse.jgit)
jgit_version = 6.10.0.202406032230-r
jgit_version = 7.0.0.202409031743-r
## Apache Commons Math (https://mvnrepository.com/artifact/org.apache.commons/commons-math3)
commons_math_version = 3.6.1
## Apache Commons Text (https://mvnrepository.com/artifact/org.apache.commons/commons-text)
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
7 changes: 5 additions & 2 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
#

##############################################################################
#
Expand Down Expand Up @@ -55,7 +57,7 @@
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
Expand Down Expand Up @@ -84,7 +86,8 @@ done
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s
' "$PWD" ) || exit

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
Expand Down
2 changes: 2 additions & 0 deletions gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
@rem SPDX-License-Identifier: Apache-2.0
@rem

@if "%DEBUG%"=="" @echo off
@rem ##########################################################################
Expand Down
8 changes: 5 additions & 3 deletions src/main/java/de/hysky/skyblocker/SkyblockerScreen.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import de.hysky.skyblocker.annotations.Init;
import de.hysky.skyblocker.config.SkyblockerConfigManager;
import de.hysky.skyblocker.skyblock.Tips;
import de.hysky.skyblocker.utils.render.RenderHelper;
import de.hysky.skyblocker.utils.scheduler.Scheduler;
import net.fabricmc.fabric.api.client.command.v2.ClientCommandManager;
import net.fabricmc.fabric.api.client.command.v2.ClientCommandRegistrationCallback;
Expand All @@ -11,6 +12,7 @@
import net.minecraft.client.gui.screen.ConfirmLinkScreen;
import net.minecraft.client.gui.screen.Screen;
import net.minecraft.client.gui.widget.*;
import net.minecraft.client.render.RenderLayer;
import net.minecraft.screen.ScreenTexts;
import net.minecraft.text.OrderedText;
import net.minecraft.text.StringVisitable;
Expand Down Expand Up @@ -90,8 +92,8 @@ protected void init() {
}

@Override
protected void initTabNavigation() {
super.initTabNavigation();
protected void refreshWidgetPositions() {
super.refreshWidgetPositions();
this.layout.refreshPositions();
}

Expand Down Expand Up @@ -130,7 +132,7 @@ public void renderWidget(DrawContext context, int mouseX, int mouseY, float delt
int iconY = y - 13;

context.drawTextWithShadow(textRenderer, orderedText, x, y, this.getTextColor());
context.drawTexture(this.icon, iconX, iconY, 0, 0, 32, 32, 32, 32);
context.drawTexture(RenderLayer::getGuiTextured, this.icon, iconX, iconY, 0, 0, 32, 32, 32, 32);
}

private OrderedText trim(Text text, int width) {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/de/hysky/skyblocker/UpdateNotifications.java
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ private static void checkForNewVersion() {
.withUnderline(true)
.withClickEvent(new ClickEvent(ClickEvent.Action.OPEN_URL, downloadLink)));

CLIENT.player.sendMessage(Constants.PREFIX.get().append(Text.translatable("skyblocker.updateNotifications.newUpdateMessage", versionText)));
CLIENT.player.sendMessage(Constants.PREFIX.get().append(Text.translatable("skyblocker.updateNotifications.newUpdateMessage", versionText)), false);
SystemToast.add(CLIENT.getToastManager(), TOAST_TYPE, Text.translatable("skyblocker.updateNotifications.newUpdateToast.title"), Text.stringifiedTranslatable("skyblocker.updateNotifications.newUpdateToast.description", newVersion.version()));
}
} catch (Exception e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ public void registerCategories(@NotNull IRecipeCategoryRegistration registration

@Override
public void registerRecipes(@NotNull IRecipeRegistration registration) {
registration.getIngredientManager().addIngredientsAtRuntime(VanillaTypes.ITEM_STACK, ItemRepository.getItems());
//FIXME no clue what to replace any of this with, we can't use items as that does not work
/*registration.getIngredientManager().addIngredientsAtRuntime(VanillaTypes.ITEM_STACK, ItemRepository.getItems());
registration.addRecipes(skyblockCraftingRecipeCategory.getRecipeType(), ItemRepository.getRecipesStream().map(recipe ->
new RecipeEntry<CraftingRecipe>(recipe.getId(), new ShapedRecipe("", CraftingRecipeCategory.MISC, RawShapedRecipe.create(Map.of(
'a', Ingredient.ofStacks(recipe.getGrid().get(0)),
Expand All @@ -60,6 +61,6 @@ public void registerRecipes(@NotNull IRecipeRegistration registration) {
'h', Ingredient.ofStacks(recipe.getGrid().get(7)),
'i', Ingredient.ofStacks(recipe.getGrid().get(8))
), "abc", "def", "ghi"), recipe.getResult()))
).toList());
).toList());*/
}
}
8 changes: 4 additions & 4 deletions src/main/java/de/hysky/skyblocker/debug/Debug.java
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public static void init() {
.stream()
.map(entity -> entity.writeNbt(new NbtCompound()))
.map(NbtHelper::toPrettyPrintedText)
.forEach(client.player::sendMessage);
.forEach(text -> client.player.sendMessage(text, false));
keyDown = true;
} else if (!dumpNearbyEntitiesKey.wasPressed() && keyDown) {
keyDown = false;
Expand All @@ -83,9 +83,9 @@ public static void init() {
Slot focusedSlot = ((HandledScreenAccessor) handledScreen).getFocusedSlot();
if (dumpHoveredItemKey.matchesKey(key, scancode) && client.player != null && focusedSlot != null && focusedSlot.hasStack()) {
if (!Screen.hasShiftDown()) {
client.player.sendMessage(Constants.PREFIX.get().append(Text.literal("Hovered Item: " + SkyblockerMod.GSON_COMPACT.toJson(ItemStack.CODEC.encodeStart(ItemStackComponentizationFixer.getRegistryLookup().getOps(JsonOps.INSTANCE), focusedSlot.getStack()).getOrThrow()))));
client.player.sendMessage(Constants.PREFIX.get().append(Text.literal("Hovered Item: " + SkyblockerMod.GSON_COMPACT.toJson(ItemStack.CODEC.encodeStart(ItemStackComponentizationFixer.getRegistryLookup().getOps(JsonOps.INSTANCE), focusedSlot.getStack()).getOrThrow()))), false);
} else {
client.player.sendMessage(Constants.PREFIX.get().append(Text.literal("Held Item NW Calcs: " + SkyblockerMod.GSON_COMPACT.toJson(Calculation.LIST_CODEC.encodeStart(JsonOps.INSTANCE, NetworthCalculator.getItemNetworth(focusedSlot.getStack()).calculations()).getOrThrow()))));
client.player.sendMessage(Constants.PREFIX.get().append(Text.literal("Held Item NW Calcs: " + SkyblockerMod.GSON_COMPACT.toJson(Calculation.LIST_CODEC.encodeStart(JsonOps.INSTANCE, NetworthCalculator.getItemNetworth(focusedSlot.getStack()).calculations()).getOrThrow()))), false);
}
}
});
Expand Down Expand Up @@ -136,4 +136,4 @@ private static LiteralArgumentBuilder<FabricClientCommandSource> dumpArmorStandH
return Command.SINGLE_SUCCESS;
});
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,20 @@

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 com.llamalad7.mixinextras.injector.v2.WrapWithCondition;

import de.hysky.skyblocker.config.SkyblockerConfigManager;
import de.hysky.skyblocker.utils.Utils;
import net.minecraft.client.gui.screen.ingame.AbstractInventoryScreen;
import net.minecraft.client.gui.DrawContext;
import net.minecraft.client.gui.screen.ingame.InventoryScreen;
import net.minecraft.client.gui.screen.ingame.StatusEffectsDisplay;

@Mixin(AbstractInventoryScreen.class)
@Mixin(InventoryScreen.class)
public class AbstractInventoryScreenMixin {

@Inject(method = "drawStatusEffects", at = @At("HEAD"), cancellable = true)
private void skyblocker$dontDrawStatusEffects(CallbackInfo ci) {
if (Utils.isOnSkyblock() && SkyblockerConfigManager.get().uiAndVisuals.hideStatusEffectOverlay) ci.cancel();
@WrapWithCondition(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/screen/ingame/StatusEffectsDisplay;drawStatusEffects(Lnet/minecraft/client/gui/DrawContext;IIF)V"))
private boolean skyblocker$dontDrawStatusEffects(StatusEffectsDisplay statusEffectsDisplay, DrawContext context, int mouseX, int mouseY, float tickDelta) {
return !(Utils.isOnSkyblock() && SkyblockerConfigManager.get().uiAndVisuals.hideStatusEffectOverlay);
}
}
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
package de.hysky.skyblocker.mixins;

import com.llamalad7.mixinextras.injector.ModifyReturnValue;
import com.llamalad7.mixinextras.sugar.Local;
import com.mojang.blaze3d.systems.RenderSystem;

import de.hysky.skyblocker.config.SkyblockerConfigManager;
import de.hysky.skyblocker.config.configs.CrimsonIsleConfig;
import de.hysky.skyblocker.utils.Utils;
import net.minecraft.block.enums.CameraSubmersionType;
import net.minecraft.client.render.BackgroundRenderer;
import net.minecraft.client.render.Camera;
import net.minecraft.client.render.FogShape;
import net.minecraft.client.render.Fog;

import org.joml.Vector4f;
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;

@Mixin(BackgroundRenderer.class)
public abstract class BackgroundRendererMixin {
Expand All @@ -21,8 +22,8 @@ public abstract class BackgroundRendererMixin {
* Moves fog farther away from the player when in the crimson isles.
* This sets it to be the same distance as what you would see in the overworld (every other skyblock island)
*/
@Inject(method = "applyFog", at = @At("RETURN"))
private static void applyFogModifyDistance(CallbackInfo ci, @Local(argsOnly = true) Camera camera, @Local(argsOnly = true) BackgroundRenderer.FogType fogType, @Local(argsOnly = true, ordinal = 0) float viewDistance, @Local(argsOnly = true) boolean thickFog) {
@ModifyReturnValue(method = "applyFog", at = @At("RETURN"))
private static Fog applyFogModifyDistance(Fog original, @Local(argsOnly = true) Camera camera, @Local(argsOnly = true) BackgroundRenderer.FogType fogType, @Local(argsOnly = true) Vector4f color, @Local(argsOnly = true, ordinal = 0) float viewDistance, @Local(argsOnly = true) boolean thickFog) {
final CameraSubmersionType cameraSubmersionType = camera.getSubmersionType();
CrimsonIsleConfig config = SkyblockerConfigManager.get().crimsonIsle;

Expand All @@ -34,9 +35,9 @@ private static void applyFogModifyDistance(CallbackInfo ci, @Local(argsOnly = tr
start = viewDistance - Math.clamp(viewDistance / 10.0f, 4.0f, 64.0f);
}

RenderSystem.setShaderFogStart(start);
RenderSystem.setShaderFogEnd(viewDistance);
RenderSystem.setShaderFogShape(FogShape.CYLINDER);
return new Fog(start, original.end(), original.shape(), original.red(), original.green(), original.blue(), original.alpha());
}

return original;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@

@Mixin(ClientPlayNetworkHandler.class)
public abstract class ClientPlayNetworkHandlerMixin {
@Shadow
private ClientWorld world;
@Shadow
private ClientWorld world;

@Shadow
@Final
Expand All @@ -58,7 +58,7 @@ public abstract class ClientPlayNetworkHandlerMixin {
}
}

@Inject(method = "method_37472", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/world/ClientWorld;removeEntity(ILnet/minecraft/entity/Entity$RemovalReason;)V"))
@Inject(method = "method_64896", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/world/ClientWorld;removeEntity(ILnet/minecraft/entity/Entity$RemovalReason;)V"))
private void skyblocker$onItemDestroy(int entityId, CallbackInfo ci) {
if (world.getEntityById(entityId) instanceof ItemEntity itemEntity) {
DungeonManager.onItemPickup(itemEntity);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import net.minecraft.component.ComponentType;
import net.minecraft.component.DataComponentTypes;
import net.minecraft.item.ItemStack;
import net.minecraft.item.trim.ArmorTrim;
import net.minecraft.item.equipment.trim.ArmorTrim;

@Mixin(ComponentHolder.class)
public interface ComponentHolderMixin {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@

@Mixin(DrawContext.class)
public abstract class DrawContextMixin {
@ModifyExpressionValue(method = "drawItemInSlot(Lnet/minecraft/client/font/TextRenderer;Lnet/minecraft/item/ItemStack;IILjava/lang/String;)V",
at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/player/ItemCooldownManager;getCooldownProgress(Lnet/minecraft/item/Item;F)F"))
@ModifyExpressionValue(method = "drawCooldownProgress", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/player/ItemCooldownManager;getCooldownProgress(Lnet/minecraft/item/ItemStack;F)F"))
private float skyblocker$modifyItemCooldown(float cooldownProgress, @Local(argsOnly = true) ItemStack stack) {
return Utils.isOnSkyblock() && ItemCooldowns.isOnCooldown(stack) ? ItemCooldowns.getItemCooldownEntry(stack).getRemainingCooldownPercent() : cooldownProgress;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ public class DyedColorComponentMixin {
String itemUuid = ItemUtils.getItemUuid(stack);

if (SkyblockerConfigManager.get().general.customAnimatedDyes.containsKey(itemUuid)) {
return ColorHelper.Argb.fullAlpha(CustomArmorAnimatedDyes.animateColorTransition(SkyblockerConfigManager.get().general.customAnimatedDyes.get(itemUuid)));
return ColorHelper.fullAlpha(CustomArmorAnimatedDyes.animateColorTransition(SkyblockerConfigManager.get().general.customAnimatedDyes.get(itemUuid)));
}

return ColorHelper.Argb.fullAlpha(SkyblockerConfigManager.get().general.customDyeColors.getOrDefault(itemUuid, originalColor));
return ColorHelper.fullAlpha(SkyblockerConfigManager.get().general.customDyeColors.getOrDefault(itemUuid, originalColor));
}

return originalColor;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
import net.minecraft.entity.Entity;
import net.minecraft.entity.EquipmentSlot;
import net.minecraft.entity.decoration.ArmorStandEntity;

import org.objectweb.asm.Opcodes;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Unique;
import org.spongepowered.asm.mixin.injection.At;
Expand All @@ -25,8 +27,8 @@ public class EntityRenderDispatcherMixin {
return Utils.isInDungeons() && SkyblockerConfigManager.get().dungeons.hideSoulweaverSkulls && entity instanceof ArmorStandEntity armorStand && entity.isInvisible() && armorStand.hasStackEquipped(EquipmentSlot.HEAD) ? !ItemUtils.getHeadTexture(armorStand.getEquippedStack(EquipmentSlot.HEAD)).equals(SOULWEAVER_SKULL_TEXTURE) : original;
}

@ModifyExpressionValue(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/Entity;isInvisible()Z", ordinal = 1))
private <E extends Entity> boolean skyblocker$armorStandHitboxVisible(boolean invisible, E entity) {
@ModifyExpressionValue(method = "render(Lnet/minecraft/entity/Entity;DDDFLnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/client/render/VertexConsumerProvider;ILnet/minecraft/client/render/entity/EntityRenderer;)V", at = @At(value = "FIELD", target = "Lnet/minecraft/client/render/entity/state/EntityRenderState;invisible:Z", opcode = Opcodes.GETFIELD, ordinal = 1))
private <E extends Entity> boolean skyblocker$armorStandHitboxVisible(boolean invisible, @Local(argsOnly = true) E entity) {
return (!(entity instanceof ArmorStandEntity) || !Utils.isOnHypixel() || !Debug.debugEnabled() || !SkyblockerConfigManager.get().debug.showInvisibleArmorStands) && invisible;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,8 @@
import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
import net.minecraft.block.FarmlandBlock;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.shape.VoxelShape;
import net.minecraft.util.shape.VoxelShapes;
import net.minecraft.world.BlockView;
import org.spongepowered.asm.mixin.Final;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
Expand All @@ -31,7 +29,7 @@ protected FarmlandBlockMixin(Settings settings) {
}

@Override
public VoxelShape getCullingShape(BlockState state, BlockView world, BlockPos pos) {
public VoxelShape getCullingShape(BlockState state) {
return SHAPE;
}
}
Loading

0 comments on commit 6bcf1db

Please sign in to comment.