From 3c52380c2189c3fe1ba0872d8fe6295824171e82 Mon Sep 17 00:00:00 2001 From: mrAppleXZ Date: Fri, 17 Apr 2020 01:13:51 +0500 Subject: [PATCH] Port to Minecraft 1.15.2 --- README.MD | 4 +-- build.gradle.kts | 3 ++- gradle.properties | 27 ++++++++++--------- .../pearx/craftdumper/client/DumperToast.kt | 7 ++--- .../dumper/standard/vanilla/DumperBiomes.kt | 2 +- .../dumper/standard/vanilla/DumperEntities.kt | 2 +- .../dumper/standard/vanilla/DumperFluids.kt | 4 +-- .../dumper/standard/vanilla/DumperModels.kt | 8 +++--- .../standard/vanilla/DumperVillagerStuff.kt | 8 +++--- 9 files changed, 34 insertions(+), 31 deletions(-) diff --git a/README.MD b/README.MD index 9630fab..ea20a95 100644 --- a/README.MD +++ b/README.MD @@ -1,7 +1,7 @@ # CraftDumper [![CurseForge Downloads](http://cf.way2muchnoise.eu/full_354281_downloads.svg)](https://www.curseforge.com/minecraft/mc-mods/craftdumper) [![Discord](https://img.shields.io/discord/136085738151346176?color=7289DA&logo=discord&logoColor=white)](https://discord.gg/tkDUmpQ) -[![Build Status](https://ci.pearx.net/job/pearxteam/job/craftdumper/job/1.14-master/badge/icon?subject=1.14-master)](https://ci.pearx.net/job/pearxteam/job/craftdumper/job/1.14-master/) -[![Build Status](https://ci.pearx.net/job/pearxteam/job/craftdumper/job/1.14-develop/badge/icon?subject=1.14-develop)](https://ci.pearx.net/job/pearxteam/job/craftdumper/job/1.14-develop/) +[![Build Status](https://ci.pearx.net/job/pearxteam/job/craftdumper/job/1.15-master/badge/icon?subject=1.15-master)](https://ci.pearx.net/job/pearxteam/job/craftdumper/job/1.15-master/) +[![Build Status](https://ci.pearx.net/job/pearxteam/job/craftdumper/job/1.15-develop/badge/icon?subject=1.15-develop)](https://ci.pearx.net/job/pearxteam/job/craftdumper/job/1.15-develop/) A Minecraft Forge mod that allows you to dump game information such as blocks, items and many more. diff --git a/build.gradle.kts b/build.gradle.kts index 3aef4c3..5c7292c 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -23,6 +23,7 @@ val modAcceptedMcVersions: String by project val forgeVersion: String by project val minecraftVersion: String by project val mcpMappingsChannel: String by project +val mcpMappingsMinecraftVersion: String by project val mcpMappingsVersion: String by project val jeiVersion: String by project @@ -64,7 +65,7 @@ dependencies { } configure { - mappings(mcpMappingsChannel, "$mcpMappingsVersion-$minecraftVersion") + mappings(mcpMappingsChannel, "$mcpMappingsVersion-$mcpMappingsMinecraftVersion") accessTransformer(file("src/main/resources/META-INF/accesstransformer.cfg")) runs { diff --git a/gradle.properties b/gradle.properties index 215ffea..8791537 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,9 +1,9 @@ org.gradle.jvmargs=-Xmx3G -modVersion=2.0.0 -modChangelog=Port to 1.14.4 +modVersion=3.0.0 +modChangelog=Port to 1.15.2 modDescription=A Minecraft Forge mod that can create dumps of various game stuff, such as blocks, items, entities and many more. -modAcceptedMcVersions=[1.14] +modAcceptedMcVersions=[1.15] curseGradleVersion=1.4.0 curseMavenVersion=2.1.1 @@ -11,18 +11,19 @@ curseforgeProjectId=354281 curseforgeReleaseType=beta githubReleaseVersion=2.2.12 -githubReleaseBranch=1.14-master +githubReleaseBranch=1.15-master -forgeGradleVersion=3.0.168 -forgeVersion=28.2.3 -minecraftVersion=1.14.4 -mcpMappingsChannel=stable -mcpMappingsVersion=58 +forgeGradleVersion=3.0.169 +forgeVersion=31.1.46 +minecraftVersion=1.15.2 +mcpMappingsChannel=snapshot +mcpMappingsMinecraftVersion=1.15.1 +mcpMappingsVersion=20200416 -jeiVersion=6.0.0.27 -jeiMcVersion=1.14.4 -projectEFileId=2855942 -kottleFileId=2838583 +jeiVersion=6.0.0.3 +jeiMcVersion=1.15.2 +projectEFileId=2898245 +kottleFileId=2895068 kotlinVersion=1.3.61 jdkVersion=8 \ No newline at end of file diff --git a/src/main/kotlin/net/pearx/craftdumper/client/DumperToast.kt b/src/main/kotlin/net/pearx/craftdumper/client/DumperToast.kt index 5a229b8..b7e7654 100644 --- a/src/main/kotlin/net/pearx/craftdumper/client/DumperToast.kt +++ b/src/main/kotlin/net/pearx/craftdumper/client/DumperToast.kt @@ -1,9 +1,10 @@ package net.pearx.craftdumper.client -import com.mojang.blaze3d.platform.GlStateManager.color3f -import com.mojang.blaze3d.platform.GlStateManager.enableBlend +import com.mojang.blaze3d.systems.RenderSystem.color3f +import com.mojang.blaze3d.systems.RenderSystem.enableBlend import net.minecraft.client.gui.AbstractGui import net.minecraft.client.gui.toasts.IToast +import net.minecraft.client.gui.toasts.IToast.TEXTURE_TOASTS import net.minecraft.client.gui.toasts.ToastGui import net.minecraft.util.math.MathHelper.clampedLerp import net.minecraft.util.text.ITextComponent @@ -20,7 +21,7 @@ class DumperToast(private val token: Int, @Volatile var progress: Float = 0F, va with(toastGui) { with(minecraft.textureManager) { with(minecraft.fontRenderer) { - bindTexture(IToast.TEXTURE_TOASTS) + bindTexture(TEXTURE_TOASTS) color3f(1.0f, 1.0f, 1.0f) toastGui.blit(0, 0, 0, 96, 160, 32) enableBlend() diff --git a/src/main/kotlin/net/pearx/craftdumper/common/dumper/standard/vanilla/DumperBiomes.kt b/src/main/kotlin/net/pearx/craftdumper/common/dumper/standard/vanilla/DumperBiomes.kt index 1cad57b..ab06f93 100644 --- a/src/main/kotlin/net/pearx/craftdumper/common/dumper/standard/vanilla/DumperBiomes.kt +++ b/src/main/kotlin/net/pearx/craftdumper/common/dumper/standard/vanilla/DumperBiomes.kt @@ -35,7 +35,7 @@ val DumperBiomes = dumperTable { "Under Block", "River Biome", "Spawning Chance", - *enumValues().mapArray { classification -> "${classification.func_220363_a().capitalize()} Spawn List: Entity*(Min Group-Max Group):Weight" } + *enumValues().mapArray { classification -> "${classification.getName().capitalize()} Spawn List: Entity*(Min Group-Max Group):Weight" } ) amounts { +ForgeRegistries.BIOMES.keys } count { ForgeRegistries.BIOMES.count() } diff --git a/src/main/kotlin/net/pearx/craftdumper/common/dumper/standard/vanilla/DumperEntities.kt b/src/main/kotlin/net/pearx/craftdumper/common/dumper/standard/vanilla/DumperEntities.kt index a68601b..6e1eeda 100644 --- a/src/main/kotlin/net/pearx/craftdumper/common/dumper/standard/vanilla/DumperEntities.kt +++ b/src/main/kotlin/net/pearx/craftdumper/common/dumper/standard/vanilla/DumperEntities.kt @@ -23,7 +23,7 @@ val DumperEntities = dumperTable { add { registryName.toString() } add { name.unformattedComponentText } add { create(defaultWorld)?.let { it::class.java.name } ?: "" } - add { classification.func_220363_a() } + add { classification.getName() } add { isSerializable.toPlusMinusString() } add { isSummonable.toPlusMinusString() } add { isImmuneToFire.toPlusMinusString() } diff --git a/src/main/kotlin/net/pearx/craftdumper/common/dumper/standard/vanilla/DumperFluids.kt b/src/main/kotlin/net/pearx/craftdumper/common/dumper/standard/vanilla/DumperFluids.kt index 92776d4..9e98199 100644 --- a/src/main/kotlin/net/pearx/craftdumper/common/dumper/standard/vanilla/DumperFluids.kt +++ b/src/main/kotlin/net/pearx/craftdumper/common/dumper/standard/vanilla/DumperFluids.kt @@ -28,8 +28,8 @@ val DumperFluids = dumperTable { with(attributes) { add { getDisplayName(stack).unformattedComponentText } add { getTranslationKey(stack) } - add { getStill(stack)?.toTexturesPath().orEmpty() } - add { getFlowing(stack)?.toTexturesPath().orEmpty() } + add { getStillTexture(stack)?.toTexturesPath().orEmpty() } + add { getFlowingTexture(stack)?.toTexturesPath().orEmpty() } add { overlayTexture?.toTexturesPath().orEmpty() } add { getFillSound(stack)?.registryName?.toString().orEmpty() } add { getEmptySound(stack)?.registryName?.toString().orEmpty() } diff --git a/src/main/kotlin/net/pearx/craftdumper/common/dumper/standard/vanilla/DumperModels.kt b/src/main/kotlin/net/pearx/craftdumper/common/dumper/standard/vanilla/DumperModels.kt index c53f002..c92bbf8 100644 --- a/src/main/kotlin/net/pearx/craftdumper/common/dumper/standard/vanilla/DumperModels.kt +++ b/src/main/kotlin/net/pearx/craftdumper/common/dumper/standard/vanilla/DumperModels.kt @@ -33,15 +33,15 @@ val DumperModels = dumperTableClient { with(model) { val quads = getQuads(null, null, Random(0), EmptyModelData.INSTANCE) add { - getParticleTexture(EmptyModelData.INSTANCE)?.iconName?.toTexturesPath().orEmpty() + getParticleTexture(EmptyModelData.INSTANCE)?.name?.toTexturesPath().orEmpty() } add { val textures = mutableListOf() for (quad in quads) { - if (quad.sprite !in textures) - textures.add(quad.sprite) + if (quad.func_187508_a() !in textures) + textures.add(quad.func_187508_a()) } - textures.joinToString(separator = System.lineSeparator()) { it.iconName.toTexturesPath() } + textures.joinToString(separator = System.lineSeparator()) { it.name.toTexturesPath() } } add { quads.size.toString() } add { this::class.java.name } diff --git a/src/main/kotlin/net/pearx/craftdumper/common/dumper/standard/vanilla/DumperVillagerStuff.kt b/src/main/kotlin/net/pearx/craftdumper/common/dumper/standard/vanilla/DumperVillagerStuff.kt index b2b76ab..074bbd3 100644 --- a/src/main/kotlin/net/pearx/craftdumper/common/dumper/standard/vanilla/DumperVillagerStuff.kt +++ b/src/main/kotlin/net/pearx/craftdumper/common/dumper/standard/vanilla/DumperVillagerStuff.kt @@ -32,7 +32,7 @@ val DumperVillagerProfessions = dumperTable { val DumperVillagerPointsOfInterest = dumperTable { registryName = craftdumper("villager_points_of_interest") - header = listOf("ID", "Name", "BlockStates", "Max Tickets", "Work Sound", "Valid Range") + header = listOf("ID", "Name", "BlockStates", "Max Tickets", /*"Work Sound", */"Valid Range") amounts { +ForgeRegistries.POI_TYPES.keys } count { ForgeRegistries.POI_TYPES.count() } table { @@ -43,7 +43,7 @@ val DumperVillagerPointsOfInterest = dumperTable { add { toString() } add { val result = mutableListOf() - val states = field_221075_w.toMutableSet() + val states = blockStates.toMutableSet() while(states.isNotEmpty()) { val first = states.first() @@ -60,7 +60,7 @@ val DumperVillagerPointsOfInterest = dumperTable { result.joinToString(System.lineSeparator()) } add { maxFreeTickets.toString() } - add { workSound?.registryName?.toString().orEmpty() } +// add { workSound?.registryName?.toString().orEmpty() } add { func_225478_d().toString() } } } @@ -116,7 +116,7 @@ val DumperVillagerSchedules = dumperTable { for((activity, schedule) in field_221387_e) { for(time in schedule.field_221396_a) { if(time.func_221389_b() > 0) - sched[time.func_221388_a()] = activity + sched[time.duration] = activity } } sched.entries.joinToString(System.lineSeparator()) { (key, value) -> "$key - ${value.registryName}" }