diff --git a/build.gradle b/build.gradle index f4103b76d..7f86d09a5 100644 --- a/build.gradle +++ b/build.gradle @@ -65,8 +65,8 @@ ext { } MAPPING_CHANNEL = 'snapshot' MAPPING_VERSION = '20200514-1.16' - MC_VERSION = '1.16' - MCP_VERSION = '20200623.201412' + MC_VERSION = '1.16.1' + MCP_VERSION = '20200625.134731' } project(':mcp') { diff --git a/src/fmllauncher/java/net/minecraftforge/fml/loading/moddiscovery/NightConfigWrapper.java b/src/fmllauncher/java/net/minecraftforge/fml/loading/moddiscovery/NightConfigWrapper.java index 12bd134a6..edf1d4c4f 100644 --- a/src/fmllauncher/java/net/minecraftforge/fml/loading/moddiscovery/NightConfigWrapper.java +++ b/src/fmllauncher/java/net/minecraftforge/fml/loading/moddiscovery/NightConfigWrapper.java @@ -1,3 +1,22 @@ +/* + * Minecraft Forge + * Copyright (c) 2016-2019. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation version 2.1 + * of the License. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + package net.minecraftforge.fml.loading.moddiscovery; import com.electronwill.nightconfig.core.UnmodifiableConfig; diff --git a/src/main/java/net/minecraftforge/common/data/ForgeItemTagsProvider.java b/src/main/java/net/minecraftforge/common/data/ForgeItemTagsProvider.java index 2db6762f9..f23da7946 100644 --- a/src/main/java/net/minecraftforge/common/data/ForgeItemTagsProvider.java +++ b/src/main/java/net/minecraftforge/common/data/ForgeItemTagsProvider.java @@ -1,6 +1,6 @@ /* * Minecraft Forge - * func_240521_a_right (c) 2016-2019. + * Copyright (c) 2016-2019. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -12,7 +12,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * - * You should have received a func_240521_a_ of the GNU Lesser General Public + * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ diff --git a/src/main/java/net/minecraftforge/common/data/ForgeLootTableProvider.java b/src/main/java/net/minecraftforge/common/data/ForgeLootTableProvider.java index af034b503..050b00486 100644 --- a/src/main/java/net/minecraftforge/common/data/ForgeLootTableProvider.java +++ b/src/main/java/net/minecraftforge/common/data/ForgeLootTableProvider.java @@ -1,3 +1,22 @@ +/* + * Minecraft Forge + * Copyright (c) 2016-2019. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation version 2.1 + * of the License. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + package net.minecraftforge.common.data; import com.mojang.datafixers.util.Pair; diff --git a/src/main/java/net/minecraftforge/common/extensions/IAbstractRailBlock.java b/src/main/java/net/minecraftforge/common/extensions/IAbstractRailBlock.java index 5d1dabf6b..b70fa7332 100644 --- a/src/main/java/net/minecraftforge/common/extensions/IAbstractRailBlock.java +++ b/src/main/java/net/minecraftforge/common/extensions/IAbstractRailBlock.java @@ -1,3 +1,22 @@ +/* + * Minecraft Forge + * Copyright (c) 2016-2019. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation version 2.1 + * of the License. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + package net.minecraftforge.common.extensions; import net.minecraft.block.AbstractBlock; diff --git a/src/test/java/net/minecraftforge/debug/DataGeneratorTest.java b/src/test/java/net/minecraftforge/debug/DataGeneratorTest.java index 047f105bb..d313fecc1 100644 --- a/src/test/java/net/minecraftforge/debug/DataGeneratorTest.java +++ b/src/test/java/net/minecraftforge/debug/DataGeneratorTest.java @@ -103,10 +103,10 @@ public class DataGeneratorTest public static void gatherData(GatherDataEvent event) { GSON = new GsonBuilder() - .registerTypeAdapter(Variant.class, new Variant.Deserializer()) - .registerTypeAdapter(ItemCameraTransforms.class, new ItemCameraTransforms.Deserializer()) - .registerTypeAdapter(ItemTransformVec3f.class, new ItemTransformVec3f.Deserializer()) - .create(); + .registerTypeAdapter(Variant.class, new Variant.Deserializer()) + .registerTypeAdapter(ItemCameraTransforms.class, new ItemCameraTransforms.Deserializer()) + .registerTypeAdapter(ItemTransformVec3f.class, new ItemTransformVec3f.Deserializer()) + .create(); DataGenerator gen = event.getGenerator(); @@ -195,17 +195,17 @@ public class DataGeneratorTest .addOptionalTag(new ResourceLocation("forge", "storage_blocks/ruby")); // Hopefully sorting issues - getBuilder(new BlockTags.Wrapper(new ResourceLocation(MODID, "thing/one"))) - .add(Blocks.COBBLESTONE); - getBuilder(new BlockTags.Wrapper(new ResourceLocation(MODID, "thing/two"))) - .add(Blocks.DIORITE); - getBuilder(new BlockTags.Wrapper(new ResourceLocation(MODID, "thing/three"))) - .add(Blocks.ANDESITE); + func_240522_a_(BlockTags.makeWrapperTag(new ResourceLocation(MODID, "thing/one").toString())) + .func_240532_a_(Blocks.COBBLESTONE); + func_240522_a_(BlockTags.makeWrapperTag(new ResourceLocation(MODID, "thing/two").toString())) + .func_240532_a_(Blocks.DIORITE); + func_240522_a_(BlockTags.makeWrapperTag(new ResourceLocation(MODID, "thing/three").toString())) + .func_240532_a_(Blocks.ANDESITE); - getBuilder(new BlockTags.Wrapper(new ResourceLocation(MODID, "things"))) - .add(Blocks.COBBLESTONE) - .add(Blocks.DIORITE) - .add(Blocks.ANDESITE); + func_240522_a_(BlockTags.makeWrapperTag(new ResourceLocation(MODID, "things").toString())) + .func_240532_a_(Blocks.COBBLESTONE) + .func_240532_a_(Blocks.DIORITE) + .func_240532_a_(Blocks.ANDESITE); } } @@ -250,26 +250,26 @@ public class DataGeneratorTest .texture("all", mcLoc("block/dirt")) .texture("top", mcLoc("block/stone")) .element() - .cube("#all") - .face(Direction.UP) - .texture("#top") - .tintindex(0) - .end() - .end(); + .cube("#all") + .face(Direction.UP) + .texture("#top") + .tintindex(0) + .end() + .end(); // Testing consistency // Test overrides ModelFile fishingRod = withExistingParent("fishing_rod", "handheld_rod") - .texture("layer0", mcLoc("item/fishing_rod")) - .override() + .texture("layer0", mcLoc("item/fishing_rod")) + .override() .predicate(mcLoc("cast"), 1) .model(getExistingFile(mcLoc("item/fishing_rod_cast"))) // Use the vanilla model for validation .end(); withExistingParent("fishing_rod_cast", modLoc("fishing_rod")) - .parent(fishingRod) - .texture("layer0", mcLoc("item/fishing_rod_cast")); + .parent(fishingRod) + .texture("layer0", mcLoc("item/fishing_rod_cast")); } private static final Set IGNORED_MODELS = ImmutableSet.of("test_generated_model", "test_block_model"); @@ -317,44 +317,44 @@ public class DataGeneratorTest for (Direction dir : FenceGateBlock.HORIZONTAL_FACING.getAllowedValues()) { int angle = (int) dir.getHorizontalAngle(); builder - .partialState() + .partialState() .with(FenceGateBlock.HORIZONTAL_FACING, dir) .with(FenceGateBlock.IN_WALL, false) .with(FenceGateBlock.OPEN, false) .modelForState() - .modelFile(invisbleModel) + .modelFile(invisbleModel) .nextModel() - .modelFile(birchFenceGate) - .rotationY(angle) - .uvLock(true) - .weight(100) + .modelFile(birchFenceGate) + .rotationY(angle) + .uvLock(true) + .weight(100) .addModel() - .partialState() + .partialState() .with(FenceGateBlock.HORIZONTAL_FACING, dir) .with(FenceGateBlock.IN_WALL, false) .with(FenceGateBlock.OPEN, true) .modelForState() - .modelFile(birchFenceGateOpen) - .rotationY(angle) - .uvLock(true) + .modelFile(birchFenceGateOpen) + .rotationY(angle) + .uvLock(true) .addModel() - .partialState() + .partialState() .with(FenceGateBlock.HORIZONTAL_FACING, dir) .with(FenceGateBlock.IN_WALL, true) .with(FenceGateBlock.OPEN, false) .modelForState() - .modelFile(birchFenceGateWall) - .rotationY(angle) - .uvLock(true) + .modelFile(birchFenceGateWall) + .rotationY(angle) + .uvLock(true) .addModel() - .partialState() + .partialState() .with(FenceGateBlock.HORIZONTAL_FACING, dir) .with(FenceGateBlock.IN_WALL, true) .with(FenceGateBlock.OPEN, true) .modelForState() - .modelFile(birchFenceGateWallOpen) - .rotationY(angle) - .uvLock(true) + .modelFile(birchFenceGateWallOpen) + .rotationY(angle) + .uvLock(true) .addModel(); } @@ -366,48 +366,48 @@ public class DataGeneratorTest // From here on, models are 1-to-1 copies of vanilla (except for model locations) and will be tested as such below ModelFile block = models().getBuilder("block") - .guiLight(GuiLight.SIDE) - .transforms() + .guiLight(GuiLight.SIDE) + .transforms() .transform(Perspective.GUI) - .rotation(30, 225, 0) - .scale(0.625f) - .end() + .rotation(30, 225, 0) + .scale(0.625f) + .end() .transform(Perspective.GROUND) - .translation(0, 3, 0) - .scale(0.25f) - .end() + .translation(0, 3, 0) + .scale(0.25f) + .end() .transform(Perspective.FIXED) - .scale(0.5f) - .end() + .scale(0.5f) + .end() .transform(Perspective.THIRDPERSON_RIGHT) - .rotation(75, 45, 0) - .translation(0, 2.5f, 0) - .scale(0.375f) - .end() + .rotation(75, 45, 0) + .translation(0, 2.5f, 0) + .scale(0.375f) + .end() .transform(Perspective.FIRSTPERSON_RIGHT) - .rotation(0, 45, 0) - .scale(0.4f) - .end() + .rotation(0, 45, 0) + .scale(0.4f) + .end() .transform(Perspective.FIRSTPERSON_LEFT) - .rotation(0, 225, 0) - .scale(0.4f) - .end() + .rotation(0, 225, 0) + .scale(0.4f) + .end() .end(); models().getBuilder("cube") - .parent(block) - .element() + .parent(block) + .element() .allFaces((dir, face) -> face.texture("#" + dir.func_176610_l()).cullface(dir)); ModelFile furnace = models().orientable("furnace", mcLoc("block/furnace_side"), mcLoc("block/furnace_front"), mcLoc("block/furnace_top")); ModelFile furnaceLit = models().orientable("furnace_on", mcLoc("block/furnace_side"), mcLoc("block/furnace_front_on"), mcLoc("block/furnace_top")); getVariantBuilder(Blocks.FURNACE) - .forAllStates(state -> ConfiguredModel.builder() - .modelFile(state.get(FurnaceBlock.LIT) ? furnaceLit : furnace) - .rotationY((int) state.get(FurnaceBlock.FACING).getOpposite().getHorizontalAngle()) - .build() - ); + .forAllStates(state -> ConfiguredModel.builder() + .modelFile(state.get(FurnaceBlock.LIT) ? furnaceLit : furnace) + .rotationY((int) state.get(FurnaceBlock.FACING).getOpposite().getHorizontalAngle()) + .build() + ); ModelFile barrel = models().cubeBottomTop("barrel", mcLoc("block/barrel_side"), mcLoc("block/barrel_bottom"), mcLoc("block/barrel_top")); ModelFile barrelOpen = models().cubeBottomTop("barrel_open", mcLoc("block/barrel_side"), mcLoc("block/barrel_bottom"), mcLoc("block/barrel_top_open")); @@ -476,25 +476,25 @@ public class DataGeneratorTest JsonObject generatedVariants = generated.getAsJsonObject("variants"); JsonObject vanillaVariants = vanilla.getAsJsonObject("variants"); Stream.concat(generatedVariants.entrySet().stream(), vanillaVariants.entrySet().stream()) - .map(e -> e.getKey()) - .distinct() - .forEach(key -> { - JsonElement generatedVariant = generatedVariants.get(key); - JsonElement vanillaVariant = vanillaVariants.get(key); - if (generatedVariant.isJsonArray()) { - compareArrays(block, "key " + key, "random variants", generatedVariant, vanillaVariant); - for (int i = 0; i < generatedVariant.getAsJsonArray().size(); i++) { - compareVariant(block, key + "[" + i + "]", generatedVariant.getAsJsonArray().get(i).getAsJsonObject(), vanillaVariant.getAsJsonArray().get(i).getAsJsonObject()); + .map(e -> e.getKey()) + .distinct() + .forEach(key -> { + JsonElement generatedVariant = generatedVariants.get(key); + JsonElement vanillaVariant = vanillaVariants.get(key); + if (generatedVariant.isJsonArray()) { + compareArrays(block, "key " + key, "random variants", generatedVariant, vanillaVariant); + for (int i = 0; i < generatedVariant.getAsJsonArray().size(); i++) { + compareVariant(block, key + "[" + i + "]", generatedVariant.getAsJsonArray().get(i).getAsJsonObject(), vanillaVariant.getAsJsonArray().get(i).getAsJsonObject()); + } } - } - if (generatedVariant.isJsonObject()) { - if (!vanillaVariant.isJsonObject()) { - blockstateError(block, "incorrectly does not have an array of variants for key %s", key); - return; + if (generatedVariant.isJsonObject()) { + if (!vanillaVariant.isJsonObject()) { + blockstateError(block, "incorrectly does not have an array of variants for key %s", key); + return; + } + compareVariant(block, key, generatedVariant.getAsJsonObject(), vanillaVariant.getAsJsonObject()); } - compareVariant(block, key, generatedVariant.getAsJsonObject(), vanillaVariant.getAsJsonObject()); - } - }); + }); } private void compareVariant(Block block, String key, JsonObject generatedVariant, JsonObject vanillaVariant) { @@ -553,34 +553,34 @@ public class DataGeneratorTest } Stream.concat(generatedPartsByCondition.keySet().stream(), vanillaPartsByCondition.keySet().stream()) - .distinct() - .forEach(cond -> { - Collection generatedVariants = generatedPartsByCondition.get(cond); - Collection vanillaVariants = vanillaPartsByCondition.get(cond); - if (generatedVariants.size() != vanillaVariants.size()) { - if (vanillaVariants.isEmpty()) { - blockstateError(block, " has extra condition %s", cond); - } else if (generatedVariants.isEmpty()) { - blockstateError(block, " is missing condition %s", cond); - } else { - blockstateError(block, " has differing amounts of variant lists matching condition %s. Expected: %d, Found: %d", cond, vanillaVariants.size(), generatedVariants.size()); + .distinct() + .forEach(cond -> { + Collection generatedVariants = generatedPartsByCondition.get(cond); + Collection vanillaVariants = vanillaPartsByCondition.get(cond); + if (generatedVariants.size() != vanillaVariants.size()) { + if (vanillaVariants.isEmpty()) { + blockstateError(block, " has extra condition %s", cond); + } else if (generatedVariants.isEmpty()) { + blockstateError(block, " is missing condition %s", cond); + } else { + blockstateError(block, " has differing amounts of variant lists matching condition %s. Expected: %d, Found: %d", cond, vanillaVariants.size(), generatedVariants.size()); + } + return; } - return; - } - if (!vanillaVariants.containsAll(generatedVariants) || !generatedVariants.containsAll(vanillaVariants)) { - List extra = new ArrayList<>(generatedVariants); - extra.removeAll(vanillaVariants); - List missing = new ArrayList<>(vanillaVariants); - missing.removeAll(generatedVariants); - if (!extra.isEmpty()) { - blockstateError(block, " has extra variants for condition %s: %s", cond, extra); + if (!vanillaVariants.containsAll(generatedVariants) || !generatedVariants.containsAll(vanillaVariants)) { + List extra = new ArrayList<>(generatedVariants); + extra.removeAll(vanillaVariants); + List missing = new ArrayList<>(vanillaVariants); + missing.removeAll(generatedVariants); + if (!extra.isEmpty()) { + blockstateError(block, " has extra variants for condition %s: %s", cond, extra); + } + if (!missing.isEmpty()) { + blockstateError(block, " has missing variants for condition %s: %s", cond, missing); + } } - if (!missing.isEmpty()) { - blockstateError(block, " has missing variants for condition %s: %s", cond, missing); - } - } - }); + }); } // Eliminate some formatting differences that are not meaningful diff --git a/src/test/java/net/minecraftforge/debug/DeferredRegistryTest.java b/src/test/java/net/minecraftforge/debug/DeferredRegistryTest.java index c5971ae42..b0b3ec810 100644 --- a/src/test/java/net/minecraftforge/debug/DeferredRegistryTest.java +++ b/src/test/java/net/minecraftforge/debug/DeferredRegistryTest.java @@ -1,3 +1,22 @@ +/* + * Minecraft Forge + * Copyright (c) 2016-2019. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation version 2.1 + * of the License. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + package net.minecraftforge.debug; import java.util.function.Supplier;