Skip to content

Commit

Permalink
Merge pull request #1 from AllayMC/feat/1.21.30
Browse files Browse the repository at this point in the history
feat: 1.21.30
  • Loading branch information
IWareQ authored Sep 16, 2024
2 parents 3105db3 + 3c7127c commit 4bf8bc1
Show file tree
Hide file tree
Showing 11 changed files with 181 additions and 31 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.gradle
.idea
build
build
scheme.json
2 changes: 1 addition & 1 deletion block-updater/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
group = "org.allaymc.updater.block"
version = "1.21.20"
version = "1.21.30"

dependencies {
api(project(":common"))
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
package org.allaymc.updater.block;

import org.allaymc.updater.block.context.BlockUpdaterContext;
import org.allaymc.updater.block.context.RemapValue;

/**
* StateUpdater Project 2024/09/12
*
* @author IWareQ
*/
public class BlockStateUpdater_1_21_30 extends BlockStateUpdater {
public static final BlockStateUpdater INSTANCE = new BlockStateUpdater_1_21_30();

private BlockStateUpdater_1_21_30() {
super(1, 21, 20);
}

@Override
public void registerUpdaters(BlockUpdaterContext context) {
context.remapState("minecraft:chemistry_table", "minecraft:", "chemistry_table_type", "");
context.remapState("minecraft:cobblestone_wall", "minecraft:", "wall_block_type", "_wall",
new RemapValue("end_brick", "end_stone_brick")
);

context.addUpdater()
.match("name", "minecraft:colored_torch_bp")
.visit("states")
.match("color_bit", "0")
.removeProperty("color_bit")
.popVisit()
.replaceValue("name", "minecraft:colored_torch_blue");
context.addUpdater()
.match("name", "minecraft:colored_torch_bp")
.visit("states")
.match("color_bit", "1")
.removeProperty("color_bit")
.popVisit()
.replaceValue("name", "minecraft:colored_torch_purple");

context.addUpdater()
.match("name", "minecraft:colored_torch_rg")
.visit("states")
.match("color_bit", "0")
.removeProperty("color_bit")
.popVisit()
.replaceValue("name", "minecraft:colored_torch_red");
context.addUpdater()
.match("name", "minecraft:colored_torch_rg")
.visit("states")
.match("color_bit", "1")
.removeProperty("color_bit")
.popVisit()
.replaceValue("name", "minecraft:colored_torch_green");

context.remapState("minecraft:purpur_block", "minecraft:", "chisel_type", "",
new RemapValue("chiseled", "deprecated_purpur_block_1"),
new RemapValue("default", "purpur_block"),
new RemapValue("lines", "purpur_pillar"),
new RemapValue("smooth", "deprecated_purpur_block_2")
);
context.remapState("minecraft:sponge", "minecraft:", "sponge_type", "sponge",
new RemapValue("dry", ""),
new RemapValue("wet", "wet_")
);

context.addUpdater()
.match("name", "minecraft:tnt")
.visit("states")
.match("allow_underwater_bit", "0")
.removeProperty("allow_underwater_bit")
.popVisit()
.replaceValue("name", "minecraft:tnt");
context.addUpdater()
.match("name", "minecraft:tnt")
.visit("states")
.match("allow_underwater_bit", "1")
.removeProperty("allow_underwater_bit")
.popVisit()
.replaceValue("name", "minecraft:underwater_tnt");

context.removeProperty("minecraft:structure_void", "structure_void_type");
}
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package org.allaymc.updater.block;

import lombok.experimental.UtilityClass;
import org.cloudburstmc.nbt.NbtMap;
import org.allaymc.updater.block.context.BlockUpdaterContext;
import org.cloudburstmc.nbt.NbtMap;

import java.util.ArrayList;
import java.util.List;
Expand Down Expand Up @@ -44,6 +44,7 @@ public class BlockStateUpdaters {
updaters.add(BlockStateUpdater_1_20_80.INSTANCE);
updaters.add(BlockStateUpdater_1_21_0.INSTANCE);
updaters.add(BlockStateUpdater_1_21_20.INSTANCE);
updaters.add(BlockStateUpdater_1_21_30.INSTANCE);

var context = new BlockUpdaterContext();
updaters.forEach(updater -> {
Expand Down
38 changes: 14 additions & 24 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
plugins {
id("java-library")
id("maven-publish")
id("signing")
}

subprojects {
apply(plugin = "java-library")
apply(plugin = "maven-publish")
apply(plugin = "signing")

group = "org.allaymc"
description = "Updates Minecraft: Bedrock Edition block & item states to the latest revision"

repositories {
Expand All @@ -36,24 +33,20 @@ subprojects {

publishing {
repositories {
maven {
name = "maven-deploy"
url = uri(
System.getenv("MAVEN_DEPLOY_URL")
?: "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/"
)
credentials {
username = System.getenv("MAVEN_DEPLOY_USERNAME") ?: "username"
password = System.getenv("MAVEN_DEPLOY_PASSWORD") ?: "password"
}
}
// Jitpack requires us to publish artifacts to local maven repo
mavenLocal()
}

publications {
create<MavenPublication>("maven") {
from(components["java"])

groupId = project.group.toString()
artifactId = project.name
version = project.version.toString()

pom {
inceptionYear.set("2022")
inceptionYear.set("2024")
packaging = "jar"
url.set("https://github.com/AllayMC/StateUpdater")

Expand Down Expand Up @@ -87,16 +80,13 @@ subprojects {
}
}

signing {
val secret = System.getenv("PGP_SECRET")
val passphrase = System.getenv("PGP_PASSPHRASE")
if (secret != null && passphrase != null) {
useInMemoryPgpKeys(secret, passphrase)
sign(publishing.publications["maven"])
tasks {
withType<JavaCompile> {
options.encoding = "UTF-8"
}
}

tasks.test {
useJUnitPlatform()
withType<Test> {
useJUnitPlatform()
}
}
}
6 changes: 5 additions & 1 deletion common/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
group = "org.allaymc.updater.common"
version = "1.0.0"
version = "1.0.0"

tasks.publish {
enabled = false
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

import lombok.RequiredArgsConstructor;
import lombok.Setter;
import org.cloudburstmc.nbt.NbtMap;
import org.allaymc.updater.common.util.TagUtils;
import org.cloudburstmc.nbt.NbtMap;

import java.util.ArrayList;
import java.util.List;
Expand Down
1 change: 1 addition & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
org.gradle.parallel=true
2 changes: 1 addition & 1 deletion item-updater/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
group = "org.allaymc.updater.item"
version = "1.21.20"
version = "1.21.30"

dependencies {
api(project(":common"))
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
package org.allaymc.updater.item;

import org.allaymc.updater.item.context.ItemUpdaterContext;
import org.allaymc.updater.item.context.RemapMetaEntry;

/**
* StateUpdater Project 2024/09/12
*
* @author IWareQ
*/
public class ItemStateUpdater_1_21_30 extends ItemStateUpdater {
public static final ItemStateUpdater INSTANCE = new ItemStateUpdater_1_21_30();

private ItemStateUpdater_1_21_30() {
super(1, 21, 30);
}

@Override
public void registerUpdaters(ItemUpdaterContext context) {
context.remapMeta("minecraft:chemistry_table",
new RemapMetaEntry(0, "minecraft:compound_creator")
);
context.remapMeta("minecraft:cobblestone_wall",
new RemapMetaEntry(1, "minecraft:mossy_cobblestone_wall"),
new RemapMetaEntry(2, "minecraft:granite_wall"),
new RemapMetaEntry(3, "minecraft:diorite_wall"),
new RemapMetaEntry(4, "minecraft:andesite_wall"),
new RemapMetaEntry(5, "minecraft:sandstone_wall"),
new RemapMetaEntry(6, "minecraft:brick_wall"),
new RemapMetaEntry(7, "minecraft:stone_brick_wall"),
new RemapMetaEntry(8, "minecraft:mossy_stone_brick_wall"),
new RemapMetaEntry(9, "minecraft:nether_brick_wall"),
new RemapMetaEntry(10, "minecraft:end_stone_brick_wall"),
new RemapMetaEntry(11, "minecraft:prismarine_wall"),
new RemapMetaEntry(12, "minecraft:red_sandstone_wall"),
new RemapMetaEntry(13, "minecraft:red_nether_brick_wall")
);
context.remapMeta("minecraft:colored_torch_bp",
new RemapMetaEntry(0, "minecraft:colored_torch_blue"),
new RemapMetaEntry(8, "minecraft:colored_torch_purple"),
new RemapMetaEntry(9, "minecraft:colored_torch_purple"),
new RemapMetaEntry(10, "minecraft:colored_torch_purple"),
new RemapMetaEntry(11, "minecraft:colored_torch_purple"),
new RemapMetaEntry(12, "minecraft:colored_torch_purple"),
new RemapMetaEntry(13, "minecraft:colored_torch_purple"),
new RemapMetaEntry(14, "minecraft:colored_torch_purple"),
new RemapMetaEntry(15, "minecraft:colored_torch_purple")
);
context.remapMeta("minecraft:colored_torch_rg",
new RemapMetaEntry(0, "minecraft:colored_torch_red"),
new RemapMetaEntry(8, "minecraft:colored_torch_green"),
new RemapMetaEntry(9, "minecraft:colored_torch_green"),
new RemapMetaEntry(10, "minecraft:colored_torch_green"),
new RemapMetaEntry(11, "minecraft:colored_torch_green"),
new RemapMetaEntry(12, "minecraft:colored_torch_green"),
new RemapMetaEntry(13, "minecraft:colored_torch_green"),
new RemapMetaEntry(14, "minecraft:colored_torch_green"),
new RemapMetaEntry(15, "minecraft:colored_torch_green")
);
context.remapMeta("minecraft:purpur_block",
new RemapMetaEntry(1, "minecraft:deprecated_purpur_block_1"),
new RemapMetaEntry(2, "minecraft:purpur_pillar"),
new RemapMetaEntry(3, "minecraft:deprecated_purpur_block_2")
);
context.remapMeta("minecraft:sponge",
new RemapMetaEntry(1, "minecraft:wet_sponge")
);
}
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package org.allaymc.updater.item;

import lombok.experimental.UtilityClass;
import org.cloudburstmc.nbt.NbtMap;
import org.allaymc.updater.item.context.ItemUpdaterContext;
import org.cloudburstmc.nbt.NbtMap;

import java.util.ArrayList;
import java.util.List;
Expand Down Expand Up @@ -42,6 +42,7 @@ public class ItemStateUpdaters {
updaters.add(ItemStateUpdater_1_20_80.INSTANCE);
updaters.add(ItemStateUpdater_1_21_0.INSTANCE);
updaters.add(ItemStateUpdater_1_21_20.INSTANCE);
updaters.add(ItemStateUpdater_1_21_30.INSTANCE);

var context = new ItemUpdaterContext();
updaters.forEach(updater -> {
Expand Down

0 comments on commit 4bf8bc1

Please sign in to comment.