Skip to content

Commit

Permalink
initial port to 1.19
Browse files Browse the repository at this point in the history
  • Loading branch information
gliscowo committed May 26, 2022
1 parent e213f81 commit 1009f69
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 23 deletions.
1 change: 1 addition & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ plugins {
id 'io.github.juuxel.loom-quiltflower' version '1.6.0'
}

// TODO fix mc dep in fmj
version = "${project.mod_version}+${project.minecraft_base_version}"
group = project.maven_group

Expand Down
17 changes: 9 additions & 8 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,24 @@
org.gradle.jvmargs=-Xmx1G
# Fabric Properties
# check these on https://wispforest.io/versions
minecraft_base_version=1.18
minecraft_version=1.18.2
yarn_mappings=1.18.2+build.1
loader_version=0.13.3
minecraft_base_version=1.19
minecraft_version=1.19-pre3
yarn_mappings=1.19-pre3+build.3
loader_version=0.14.6

# Mod Properties
mod_version=0.1.10
maven_group=com.glisco
archives_base_name=interactic

# Dependencies
# check this on https://modmuss50.me/fabric.html
fabric_version=0.47.8+1.18.2
fabric_version=0.53.4+1.19

# https://maven.shedaniel.me/me/shedaniel/cloth/cloth-config-fabric/
cloth_config_version = 6.2.57
cloth_config_version = 7.0.65

# https://www.curseforge.com/minecraft/mc-mods/modmenu
modmenu_version=3.0.1
modmenu_version = 4.0.0-beta.4



Expand Down
3 changes: 1 addition & 2 deletions src/main/java/interactic/InteracticClientInit.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
import net.minecraft.client.option.KeyBinding;
import net.minecraft.client.util.InputUtil;
import net.minecraft.text.Text;
import net.minecraft.text.TranslatableText;
import net.minecraft.util.Hand;
import net.minecraft.util.Identifier;

Expand Down Expand Up @@ -73,7 +72,7 @@ public List<AbstractConfigListEntry> get(String s, Field field, Object config, O
if (((InteracticConfig) config).clientOnlyMode) return Collections.emptyList();

try {
return Collections.singletonList(builder.startBooleanToggle(new TranslatableText(s), field.getBoolean(config))
return Collections.singletonList(builder.startBooleanToggle(Text.translatable(s), field.getBoolean(config))
.setSaveConsumer(aBoolean -> trySetBoolean(field, config, aBoolean))
.setDefaultValue(field.getBoolean(defaults)).build());
} catch (IllegalAccessException e) {
Expand Down
7 changes: 3 additions & 4 deletions src/main/java/interactic/mixin/ItemEntityRendererMixin.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,14 @@
import net.minecraft.util.math.MathHelper;
import net.minecraft.util.math.Quaternion;
import net.minecraft.util.math.Vec3f;
import net.minecraft.util.math.random.Random;
import org.spongepowered.asm.mixin.Final;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;

import java.util.Random;

@Mixin(ItemEntityRenderer.class)
public abstract class ItemEntityRendererMixin extends EntityRenderer<ItemEntity> {

Expand Down Expand Up @@ -141,8 +140,8 @@ private void render(ItemEntity entity, float f, float tickDelta, MatrixStack mat

// If the block is chonky, rotate it randomly
if (treatAsDepthModel && !isFlatBlock) {
matrices.multiply(Vec3f.POSITIVE_Y.getDegreesQuaternion(this.random.nextFloat(45)));
matrices.multiply(Vec3f.POSITIVE_Z.getDegreesQuaternion(this.random.nextFloat(45)));
matrices.multiply(Vec3f.POSITIVE_Y.getDegreesQuaternion(this.random.nextFloat() * 45));
matrices.multiply(Vec3f.POSITIVE_Z.getDegreesQuaternion(this.random.nextFloat() * 45));
}

//Undo the translation from before
Expand Down
3 changes: 1 addition & 2 deletions src/main/java/interactic/util/ItemDamageSource.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import net.minecraft.entity.damage.ProjectileDamageSource;
import net.minecraft.item.*;
import net.minecraft.text.Text;
import net.minecraft.text.TranslatableText;
import org.jetbrains.annotations.Nullable;

public class ItemDamageSource extends ProjectileDamageSource {
Expand All @@ -25,6 +24,6 @@ public Text getDeathMessage(LivingEntity entity) {
if (itemStack.getItem() instanceof PickaxeItem) key = key + ".pickaxe";
if (itemStack.getItem() instanceof ShovelItem) key = key + ".shovel";
if (itemStack.getItem() instanceof HoeItem) key = key + ".hoe";
return new TranslatableText(key, entity.getDisplayName(), attackerName, itemStack.toHoverableText());
return Text.translatable(key, entity.getDisplayName(), attackerName, itemStack.toHoverableText());
}
}
11 changes: 4 additions & 7 deletions src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,10 @@
"authors": [
"glisco"
],
"contributors": [
"Draylar"
],
"contact": {
"homepage": "https://www.curseforge.com/minecraft/mc-mods/interactic",
"sources": "https://github.com/glisco03/interactic",
"issues": "https://github.com/glisco03/interactic/issues"
"sources": "https://github.com/gliscowo/interactic",
"issues": "https://github.com/gliscowo/interactic/issues"
},
"license": "MIT",
"icon": "assets/interactic/icon.png",
Expand Down Expand Up @@ -42,7 +39,7 @@
"depends": {
"fabricloader": ">=0.4.0",
"fabric": "*",
"minecraft": ">=1.18.2",
"cloth-config": ">=6.0.0"
"minecraft": ">=1.19-beta.3",
"cloth-config": ">=7.0.0"
}
}

0 comments on commit 1009f69

Please sign in to comment.