Skip to content

Commit

Permalink
updated to mc 1.21
Browse files Browse the repository at this point in the history
  • Loading branch information
Globox1997 committed Jun 22, 2024
1 parent 20d4871 commit e084edb
Show file tree
Hide file tree
Showing 11 changed files with 45 additions and 70 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
### Fixed:
-
### Changed:
- Updated to mc 1.20.6
- Updated to mc 1.21
12 changes: 6 additions & 6 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@ org.gradle.jvmargs=-Xmx1G

# Fabric Properties
# check these on https://fabricmc.net/use
minecraft_version=1.20.6
yarn_mappings=1.20.6+build.1
minecraft_version=1.21
yarn_mappings=1.21+build.2
loader_version=0.15.11

# Mod Properties
mod_version = 1.1.1
mod_version = 0.6.0
maven_group = net.rpgz
archives_base_name = rpgz

# Dependencies
# currently not on the main fabric site, check on the maven: https://maven.fabricmc.net/net/fabricmc/fabric-api/fabric-api
fabric_version=0.98.0+1.20.6
cloth_config_version=14.0.126
mod_menu_version=10.0.0-beta.1
fabric_version=0.100.3+1.21
cloth_config_version=15.0.127
mod_menu_version=11.0.0

6 changes: 3 additions & 3 deletions jitpack.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
jdk:
- openjdk17
- openjdk21
before_install:
- sdk install java 17.0.3-tem
- sdk use java 17.0.3-tem
- sdk install java 21.0.0-tem
- sdk use java 21.0.0-tem
26 changes: 26 additions & 0 deletions src/main/java/net/rpgz/RpgzClient.java
Original file line number Diff line number Diff line change
@@ -1,11 +1,37 @@
package net.rpgz;

import net.fabricmc.api.ClientModInitializer;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.fabricmc.fabric.api.client.rendering.v1.HudRenderCallback;
import net.minecraft.client.MinecraftClient;
import net.minecraft.entity.Entity;
import net.minecraft.entity.mob.MobEntity;
import net.minecraft.util.Identifier;
import net.minecraft.util.hit.EntityHitResult;
import net.minecraft.util.hit.HitResult;

@Environment(EnvType.CLIENT)
public class RpgzClient implements ClientModInitializer {

private static final Identifier LOOT_BAG_TEXTURE = Identifier.of("rpgz", "textures/sprite/loot_bag.png");

@Override
public void onInitializeClient() {
HudRenderCallback.EVENT.register((drawContext, tickCounter) -> {
MinecraftClient client = MinecraftClient.getInstance();
if (client.crosshairTarget != null && client.crosshairTarget.getType() == HitResult.Type.ENTITY) {
Entity entity = ((EntityHitResult) client.crosshairTarget).getEntity();
if (entity instanceof MobEntity) {
MobEntity deadBody = (MobEntity) entity;
if (deadBody != null && deadBody.deathTime > 20) {
int scaledWidth = client.getWindow().getScaledWidth();
int scaledHeight = client.getWindow().getScaledHeight();
drawContext.drawTexture(LOOT_BAG_TEXTURE, (scaledWidth / 2), (scaledHeight / 2) - 16, 0.0F, 0.0F, 16, 16, 16, 16);
}
}
}
});
}

}
4 changes: 2 additions & 2 deletions src/main/java/net/rpgz/init/SoundInit.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@

public class SoundInit {

public static final Identifier LOOT_SOUND = new Identifier("rpgz:loot");
public static final Identifier COIN_LOOT_SOUND = new Identifier("rpgz:coin_loot");
public static final Identifier LOOT_SOUND = Identifier.of("rpgz:loot");
public static final Identifier COIN_LOOT_SOUND = Identifier.of("rpgz:coin_loot");

public static SoundEvent LOOT_SOUND_EVENT = SoundEvent.of(LOOT_SOUND);
public static SoundEvent COIN_LOOT_SOUND_EVENT = SoundEvent.of(COIN_LOOT_SOUND);
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/net/rpgz/init/TagInit.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@

public class TagInit {

public static final TagKey<Item> RARE_ITEMS = TagKey.of(RegistryKeys.ITEM, new Identifier("rpgz", "rare_items"));
public static final TagKey<EntityType<?>> EXCLUDED_ENTITIES = TagKey.of(RegistryKeys.ENTITY_TYPE, new Identifier("rpgz", "excluded_entities"));
public static final TagKey<Item> RARE_ITEMS = TagKey.of(RegistryKeys.ITEM, Identifier.of("rpgz", "rare_items"));
public static final TagKey<EntityType<?>> EXCLUDED_ENTITIES = TagKey.of(RegistryKeys.ENTITY_TYPE, Identifier.of("rpgz", "excluded_entities"));

public static void init() {
}
Expand Down
53 changes: 0 additions & 53 deletions src/main/java/net/rpgz/mixin/client/InGameHudMixin.java

This file was deleted.

5 changes: 4 additions & 1 deletion src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@
"main": [
"net.rpgz.RpgzMain"
],
"client": [
"net.rpgz.RpgzClient"
],
"modmenu": [
"net.rpgz.config.ModMenuIntegration"
]
Expand All @@ -27,7 +30,7 @@
"rpgz.mixins.json"
],
"depends": {
"java": ">=17",
"java": ">=21",
"minecraft": ">=${minecraft_version}",
"fabric-api": ">=${fabric_version}",
"fabricloader": ">=${loader_version}",
Expand Down
3 changes: 1 addition & 2 deletions src/main/resources/rpgz.mixins.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"required": true,
"minVersion": "0.8",
"package": "net.rpgz.mixin",
"compatibilityLevel": "JAVA_17",
"compatibilityLevel": "JAVA_21",
"mixins": [
"MobEntityMixin",
"HopperBlockEntityMixin",
Expand All @@ -17,7 +17,6 @@
],
"client": [
"client.LivingEntityRendererMixin",
"client.InGameHudMixin",
"client.ClientWorldMixin",
"client.GameRendererMixin",
"client.EntityRendererMixin",
Expand Down

0 comments on commit e084edb

Please sign in to comment.