Skip to content

Commit

Permalink
Update to 1.21.3
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinthegreat1 committed Nov 29, 2024
1 parent da86ec8 commit 7f9a58b
Show file tree
Hide file tree
Showing 10 changed files with 52 additions and 31 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## Skyblock Mod 1.10.6 for 1.21

Support for 1.21.3

## Skyblock Mod 1.10.5 for 1.21

Prepare for removal of locraw from Skyblocker.
Expand Down
14 changes: 10 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
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.5.1"
id "me.modmuss50.mod-publish-plugin" version "0.8.1"
}

version = project.mod_version + '+' + project.minecraft_version
Expand Down Expand Up @@ -112,13 +112,19 @@ publishMods {
projectId = "658094"
projectSlug = "skyblockmod" // Required for discord webhook
accessToken = providers.environmentVariable("CURSEFORGE_TOKEN")
minecraftVersions.add("1.21")
minecraftVersionRange {
start = "1.21.2"
end = "1.21.3"
}
requires("fabric-api")
}
modrinth {
projectId = "GTIrlvJk"
accessToken = providers.environmentVariable("MODRINTH_TOKEN")
minecraftVersions.add("1.21")
minecraftVersionRange {
start = "1.21.2"
end = "1.21.3"
}
}
github {
repository = "kevinthegreat1/SkyblockMod-Fabric"
Expand Down
21 changes: 12 additions & 9 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,22 @@ org.gradle.jvmargs = -Xmx1G

# Fabric Properties
# check these on https://fabricmc.net/versions.html
minecraft_version = 1.21
yarn_mappings = 1.21+build.1
loader_version = 0.15.11
minecraft_version = 1.21.3
yarn_mappings = 1.21.3+build.2
loader_version = 0.16.9

# Mod Properties
mod_version = 1.10.5
mod_version = 1.10.6
maven_group = com.kevinthegreat.skyblockmod
archives_base_name = skyblock-mod

# Dependencies
fabric_version = 0.100.1+1.21
modmenu_version = 11.0.0-beta.1
skyblocker_version = v1.21.1+1.21
jgit_version = 6.9.0.202403050737-r
## Apache Commons Math (https://mvnrepository.com/artifact/org.apache.commons/commons-math3)
fabric_version = 0.110.0+1.21.3
# https://modrinth.com/mod/modmenu/versions
modmenu_version = 12.0.0-beta.1
# https://modrinth.com/mod/skyblocker-liap/versions
skyblocker_version = 1.23.0-beta.1+1.21.3
# https://mvnrepository.com/artifact/org.eclipse.jgit/org.eclipse.jgit
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
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.11.1-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
2 changes: 1 addition & 1 deletion gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,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
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.gui.DrawContext;
import net.minecraft.client.render.LightmapTextureManager;
import net.minecraft.client.render.MapRenderState;
import net.minecraft.client.render.VertexConsumerProvider;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.component.DataComponentTypes;
Expand All @@ -18,6 +19,7 @@

public class DungeonMap {
private final MapIdComponent DEFAULT_MAP_ID_COMPONENT = new MapIdComponent(1024);
private static final MapRenderState MAP_RENDER_STATE = new MapRenderState();
private MapIdComponent cachedMapIdComponent = null;

public void init() {
Expand All @@ -43,7 +45,8 @@ private void render(DrawContext context) {
matrices.push();
matrices.translate(options.dungeonMapX.getValue(), options.dungeonMapY.getValue(), 0);
matrices.scale(scaling, scaling, 0f);
client.gameRenderer.getMapRenderer().draw(matrices, vertices, mapId, state, false, LightmapTextureManager.MAX_LIGHT_COORDINATE);
client.getMapRenderer().update(mapId, state, MAP_RENDER_STATE);
client.getMapRenderer().draw(MAP_RENDER_STATE, matrices, vertices, false, LightmapTextureManager.MAX_LIGHT_COORDINATE);
vertices.draw();
matrices.pop();
}
Expand Down
7 changes: 5 additions & 2 deletions src/main/java/com/kevinthegreat/skyblockmod/misc/Fishing.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
import net.minecraft.client.network.ClientPlayerEntity;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.network.packet.s2c.play.PlaySoundS2CPacket;
import net.minecraft.registry.entry.RegistryEntry;
import net.minecraft.sound.SoundEvent;
import net.minecraft.sound.SoundEvents;
import net.minecraft.text.Text;
import net.minecraft.util.Formatting;
import net.minecraft.util.math.MathHelper;
Expand All @@ -26,8 +29,8 @@ public void reset() {

public void onSound(PlaySoundS2CPacket packet) {
MinecraftClient client = MinecraftClient.getInstance();
String path = packet.getSound().value().getId().getPath();
if (SkyblockMod.skyblockMod.options.fishing.getValue() && startTime != 0 && System.currentTimeMillis() >= startTime + 2000 && ("entity.generic.splash".equals(path) || "entity.player.splash".equals(path))) {
RegistryEntry<SoundEvent> sound = packet.getSound();
if (SkyblockMod.skyblockMod.options.fishing.getValue() && startTime != 0 && System.currentTimeMillis() >= startTime + 2000 && (sound.matchesId(SoundEvents.ENTITY_GENERIC_SPLASH.id()) || sound.matchesId(SoundEvents.ENTITY_PLAYER_SPLASH.id()))) {
ClientPlayerEntity player = client.player;
if (player != null && player.fishHook != null) {
Vec3d soundToFishHook = player.fishHook.getPos().subtract(packet.getX(), 0, packet.getZ());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
import net.minecraft.util.ActionResult;
import net.minecraft.util.DyeColor;
import net.minecraft.util.Hand;
import net.minecraft.util.TypedActionResult;
import net.minecraft.util.hit.BlockHitResult;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Direction;
Expand All @@ -36,7 +35,8 @@
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import java.util.*;
import java.util.HashMap;
import java.util.Map;
import java.util.regex.Pattern;

import static net.fabricmc.fabric.api.client.command.v2.ClientCommandManager.argument;
Expand Down Expand Up @@ -170,12 +170,12 @@ private ActionResult onInteractBlock(BlockPos pos) {
return ActionResult.PASS;
}

public TypedActionResult<ItemStack> onUseItem(PlayerEntity player, World world, Hand hand) {
public ActionResult onUseItem(PlayerEntity player, World world, Hand hand) {
ItemStack stack = player.getStackInHand(hand);
if (isActive() && ItemUtils.getItemId(stack).equals("ANCESTRAL_SPADE")) {
lastEchoTime = System.currentTimeMillis();
}
return TypedActionResult.pass(stack);
return ActionResult.PASS;
}

public void onChatMessage(Text message, boolean overlay) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@
import net.minecraft.client.MinecraftClient;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.FishingRodItem;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ActionResult;
import net.minecraft.util.Hand;
import net.minecraft.util.TypedActionResult;
import net.minecraft.world.World;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
Expand All @@ -16,14 +15,14 @@
@Mixin(FishingRodItem.class)
public abstract class FishingRodItemMixin {
@Inject(method = "use", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/player/PlayerEntity;incrementStat(Lnet/minecraft/stat/Stat;)V"))
private void skyblockmod_onCast(World world, PlayerEntity user, Hand hand, CallbackInfoReturnable<TypedActionResult<ItemStack>> cir) {
private void skyblockmod_onCast(World world, PlayerEntity user, Hand hand, CallbackInfoReturnable<ActionResult> cir) {
if (SkyblockMod.skyblockMod.options.fishing.getValue() && user.equals(MinecraftClient.getInstance().player)) {
SkyblockMod.skyblockMod.fishing.start(user);
}
}

@Inject(method = "use", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/World;playSound(Lnet/minecraft/entity/player/PlayerEntity;DDDLnet/minecraft/sound/SoundEvent;Lnet/minecraft/sound/SoundCategory;FF)V", ordinal = 0))
private void skyblockmod_onReel(World world, PlayerEntity user, Hand hand, CallbackInfoReturnable<TypedActionResult<ItemStack>> cir) {
private void skyblockmod_onReel(World world, PlayerEntity user, Hand hand, CallbackInfoReturnable<ActionResult> cir) {
if (SkyblockMod.skyblockMod.options.fishing.getValue() && user.equals(MinecraftClient.getInstance().player)) {
SkyblockMod.skyblockMod.fishing.reset();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import net.fabricmc.fabric.api.client.rendering.v1.WorldRenderContext;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.font.TextRenderer;
import net.minecraft.client.gl.ShaderProgramKeys;
import net.minecraft.client.render.*;
import net.minecraft.client.render.block.entity.BeaconBlockEntityRenderer;
import net.minecraft.client.util.BufferAllocator;
Expand Down Expand Up @@ -33,6 +34,8 @@ public static void renderFilled(WorldRenderContext context, BlockPos pos, float[
Vec3d camera = context.camera().getPos();
Tessellator tessellator = RenderSystem.renderThreadTesselator();

RenderSystem.setShader(ShaderProgramKeys.POSITION_COLOR);
RenderSystem.setShaderColor(1f, 1f, 1f, 1f);
RenderSystem.enableBlend();
RenderSystem.defaultBlendFunc();
RenderSystem.disableCull();
Expand All @@ -43,7 +46,7 @@ public static void renderFilled(WorldRenderContext context, BlockPos pos, float[
matrices.translate(-camera.getX(), -camera.getY(), -camera.getZ());

BufferBuilder buffer = tessellator.begin(VertexFormat.DrawMode.TRIANGLE_STRIP, VertexFormats.POSITION_COLOR);
WorldRenderer.renderFilledBox(matrices, buffer, pos.getX(), pos.getY(), pos.getZ(), pos.getX() + 1, pos.getY() + 1, pos.getZ() + 1, colorComponents[0], colorComponents[1], colorComponents[2], alpha);
VertexRendering.drawFilledBox(matrices, buffer, pos.getX(), pos.getY(), pos.getZ(), pos.getX() + 1, pos.getY() + 1, pos.getZ() + 1, colorComponents[0], colorComponents[1], colorComponents[2], alpha);
BufferRenderer.drawWithGlobalProgram(buffer.end());

matrices.pop();
Expand All @@ -54,7 +57,7 @@ public static void renderFilled(WorldRenderContext context, BlockPos pos, float[
public static void renderBeaconBeam(WorldRenderContext context, BlockPos pos, float[] colorComponents) {
context.matrixStack().push();
context.matrixStack().translate(pos.getX() - context.camera().getPos().x, pos.getY() - context.camera().getPos().y, pos.getZ() - context.camera().getPos().z);
BeaconBlockEntityRendererInvoker.renderBeam(context.matrixStack(), context.consumers(), context.tickCounter().getTickDelta(true), context.world().getTime(), 0, BeaconBlockEntityRenderer.MAX_BEAM_HEIGHT, ColorHelper.Argb.fromFloats(1f, colorComponents[0], colorComponents[1], colorComponents[2]));
BeaconBlockEntityRendererInvoker.renderBeam(context.matrixStack(), context.consumers(), context.tickCounter().getTickDelta(true), context.world().getTime(), 0, BeaconBlockEntityRenderer.MAX_BEAM_HEIGHT, ColorHelper.fromFloats(1f, colorComponents[0], colorComponents[1], colorComponents[2]));
context.matrixStack().pop();
}

Expand All @@ -70,7 +73,7 @@ public static void renderOutline(WorldRenderContext context, Box box, float[] co
Vec3d camera = context.camera().getPos();
Tessellator tessellator = RenderSystem.renderThreadTesselator();

RenderSystem.setShader(GameRenderer::getRenderTypeLinesProgram);
RenderSystem.setShader(ShaderProgramKeys.RENDERTYPE_LINES);
RenderSystem.setShaderColor(1f, 1f, 1f, 1f);
RenderSystem.lineWidth(lineWidth);
RenderSystem.disableCull();
Expand All @@ -81,7 +84,7 @@ public static void renderOutline(WorldRenderContext context, Box box, float[] co
matrices.translate(-camera.getX(), -camera.getY(), -camera.getZ());

BufferBuilder buffer = tessellator.begin(VertexFormat.DrawMode.LINES, VertexFormats.LINES);
WorldRenderer.drawBox(matrices, buffer, box, colorComponents[0], colorComponents[1], colorComponents[2], 1f);
VertexRendering.drawBox(matrices, buffer, box, colorComponents[0], colorComponents[1], colorComponents[2], 1f);
BufferRenderer.drawWithGlobalProgram(buffer.end());

matrices.pop();
Expand Down Expand Up @@ -122,7 +125,7 @@ public static void renderLinesFromPoints(WorldRenderContext context, Vec3d[] poi
GL11.glEnable(GL11.GL_LINE_SMOOTH);
GL11.glHint(GL11.GL_LINE_SMOOTH_HINT, GL11.GL_NICEST);

RenderSystem.setShader(GameRenderer::getRenderTypeLinesProgram);
RenderSystem.setShader(ShaderProgramKeys.RENDERTYPE_LINES);
RenderSystem.setShaderColor(1f, 1f, 1f, 1f);
RenderSystem.lineWidth(lineWidth);
RenderSystem.enableBlend();
Expand Down

0 comments on commit 7f9a58b

Please sign in to comment.