Skip to content

Commit

Permalink
Initial port to 1.20.4
Browse files Browse the repository at this point in the history
  • Loading branch information
Noaaan committed Mar 10, 2024
1 parent b646a9f commit 2fc04d6
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 39 deletions.
12 changes: 5 additions & 7 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id 'fabric-loom' version '0.11-SNAPSHOT'
id 'fabric-loom' version '1.5-SNAPSHOT'
id 'maven-publish'
id 'io.github.juuxel.loom-quiltflower' version '1.7.1'
}
Expand Down Expand Up @@ -29,12 +29,13 @@ dependencies {
annotationProcessor modImplementation("io.wispforest:owo-lib:${project.owo_version}")

// REI
modLocalRuntime "me.shedaniel:RoughlyEnoughItems-fabric:${project.rei_version}"
modCompileOnly("me.shedaniel:RoughlyEnoughItems-default-plugin:${project.rei_version}")
modCompileOnly "me.shedaniel:RoughlyEnoughItems-api-fabric:${project.rei_version}"
modRuntimeOnly "me.shedaniel:RoughlyEnoughItems-fabric:${project.rei_version}"
modRuntimeOnly "dev.architectury:architectury-fabric:${project.architectury_version}"
//modRuntimeOnly "dev.architectury:architectury-fabric:${project.architectury_version}"

// emi
modCompileOnly "dev.emi:emi:${emi_version}"
modCompileOnly "dev.emi:emi-fabric:${emi_version}"

// MM + AF + Magna + CCA
modImplementation "maven.modrinth:mythicmetals:${project.mm_version}"
Expand All @@ -46,9 +47,6 @@ dependencies {
modCompileOnly("maven.modrinth:lithium:${project.leetheum_version}")
modRuntimeOnly("maven.modrinth:lithium:${project.leetheum_version}")

// Mixin Extras
implementation(annotationProcessor("com.github.llamalad7.mixinextras:mixinextras-fabric:${project.me_version}"))

// Additional Entity Attributes
modImplementation ("maven.modrinth:additionalentityattributes:${project.aea_version}")
}
Expand Down
33 changes: 15 additions & 18 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,34 +2,31 @@
org.gradle.jvmargs=-Xmx2G
# Fabric Properties
# check these on https://fabricmc.net/develop/
minecraft_version=1.20
yarn_mappings=1.20+build.1
loader_version=0.14.21
minecraft_version=1.20.4
yarn_mappings=1.20.4+build.3
loader_version=0.15.7
# Mod Properties
mod_version=0.6.0+1.20
mod_version=0.6.0+1.20.3
maven_group=nourl
archives_base_name=mythicmetals-decorations
# Dependencies
# check this on https://modmuss50.me/fabric.html
fabric_version=0.83.0+1.20
fabric_version=0.96.4+1.20.4
# https://www.curseforge.com/minecraft/mc-mods/roughly-enough-items/files/
# https://maven.shedaniel.me/me/shedaniel/RoughlyEnoughItems-fabric/
rei_version=12.0.652
architectury_version=9.0.5
rei_version=14.0.688
architectury_version=11.0.12
# OwO
# https://maven.wispforest.io/io/wispforest/owo-lib/
owo_version=0.11.1+1.20
cca_version=5.2.0
owo_version=0.12.5+1.20.3
cca_version=5.3.0
# Mythic Metals: https://modrinth.com/mod/mythicmetals
mm_version=0.18.1+1.20-hotfix
mm_version=0.19.4+1.20.4
# Alloy Forgery: https://modrinth.com/mod/alloy-forgery
af_version=2.0.21+1.20
af_version=2.1.3+1.20.3
# leethium moment
leetheum_version=mc1.20-0.11.2
# Mixin Extras
# https://github.com/LlamaLad7/MixinExtras
me_version = 0.2.0-beta.6
leetheum_version=mc1.20.4-0.12.1
# Additional Entity Attributes
# https://github.com/DaFuqs/AdditionalEntityAttributes
aea_version=1.2.2+1.19.4
emi_version=0.7.3+1.19.4
# https://modrinth.com/mod/additionalentityattributes
aea_version=1.7.1+1.20.4
emi_version=1.1.2+1.20.4
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,13 @@ public MythicChest getFromBoth(MythicChestBlockEntity first, MythicChestBlockEnt
name,
player -> first.checkUnlocked(player) && second.checkUnlocked(player),
player -> {
first.checkLootInteraction(player);
second.checkLootInteraction(player);
first.generateLoot(player);
second.generateLoot(player);
});
}

public MythicChest getFrom(MythicChestBlockEntity chest) {
return new MythicChest(chest, chest.hasCustomName() ? chest.getCustomName() : chest.getCachedState().getBlock().getName(), chest::checkUnlocked, chest::checkLootInteraction);
return new MythicChest(chest, chest.hasCustomName() ? chest.getCustomName() : chest.getCachedState().getBlock().getName(), chest::checkUnlocked, chest::generateLoot);
}

public MythicChest getFallback() {
Expand Down Expand Up @@ -98,7 +98,7 @@ public BlockEntity createBlockEntity(BlockPos pos, BlockState state) {
@Nullable
@Override
public <T extends BlockEntity> BlockEntityTicker<T> getTicker(World world, BlockState state, BlockEntityType<T> type) {
return world.isClient ? checkType(type, MythicChests.MYTHIC_CHEST_BLOCK_ENTITY_TYPE, MythicChestBlockEntity::clientTick) : null;
return world.isClient ? validateTicker(type, MythicChests.MYTHIC_CHEST_BLOCK_ENTITY_TYPE, MythicChestBlockEntity::clientTick) : null;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public MythicChestBlockEntity(BlockPos pos, BlockState state) {
}

@Override
protected DefaultedList<ItemStack> getInvStackList() {
protected DefaultedList<ItemStack> method_11282() {
return inventory;
}

Expand Down Expand Up @@ -113,10 +113,10 @@ public void readNbt(NbtCompound nbt) {
this.lock = ContainerLock.fromNbt(nbt);

if (nbt.contains("CustomName", NbtElement.STRING_TYPE)) {
this.setCustomName(Text.Serializer.fromJson(nbt.getString("CustomName")));
this.setCustomName(Text.Serialization.fromJson(nbt.getString("CustomName")));
}

if (!this.deserializeLootTable(nbt)) {
if (!this.readLootTable(nbt)) {
this.inventory = DefaultedList.ofSize(this.size(), ItemStack.EMPTY);
NbtList nbtList = nbt.getList("Items", 10);

Expand All @@ -135,10 +135,10 @@ protected void writeNbt(NbtCompound nbt) {
this.lock.writeNbt(nbt);

if (this.hasCustomName()) {
nbt.putString("CustomName", Text.Serializer.toJson(this.getCustomName()));
nbt.putString("CustomName", Text.Serialization.toJsonString(this.getCustomName()));
}

if (!this.serializeLootTable(nbt)) {
if (!this.readLootTable(nbt)) {
NbtList nbtList = new NbtList();

for (int i = 0; i < this.inventory.size(); i++) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ public void render(DrawContext drawContext, int mouseX, int mouseY, float delta)

@Override
protected void drawBackground(DrawContext drawContext, float delta, int mouseX, int mouseY) {
this.renderBackground(drawContext);
//super.renderBackground(drawContext, mouseX, mouseY, delta);

drawContext.drawTexture(TEXTURE, this.x, this.y, 0, 0, this.size.width() + ChestScreenSize.HORIZONTAL_PADDING, this.size.paddedHeight(), 368, 416);
drawContext.drawTexture(TEXTURE, this.x + this.size.width() + ChestScreenSize.HORIZONTAL_PADDING, this.y, 331, 0, ChestScreenSize.HORIZONTAL_PADDING, this.size.paddedHeight(), 368, 416);
Expand Down Expand Up @@ -196,15 +196,15 @@ private boolean isInScrollbar(double mouseX, double mouseY) {
}

@Override
public boolean mouseScrolled(double mouseX, double mouseY, double amount) {
public boolean mouseScrolled(double mouseX, double mouseY, double horizontalAmount, double verticalAmount) {
if (MythicMetalsDecorations.CONFIG.onlyScrollOnScrollbar()) {
if (isInScrollbar(mouseX, mouseY)) {
this.scroll((int) (this.scrollOffset - amount));
this.scroll((int) (this.scrollOffset - verticalAmount));
return true;
}
return false;
}
this.scroll((int) (this.scrollOffset - amount));
this.scroll((int) (this.scrollOffset - verticalAmount));
return true;
}

Expand Down

0 comments on commit 2fc04d6

Please sign in to comment.