mirror of
https://github.com/BlueMap-Minecraft/BlueMap.git
synced 2024-11-24 11:38:37 +01:00
Make everything 1.12.x compatible
This commit is contained in:
parent
1c44bd2ac4
commit
b24b2241ca
@ -37,7 +37,7 @@
|
||||
public class DoorExtension implements BlockStateExtension {
|
||||
|
||||
private static final Collection<String> AFFECTED_BLOCK_IDS = Lists.newArrayList(
|
||||
"minecraft:oak_door",
|
||||
"minecraft:wooden_door",
|
||||
"minecraft:iron_door",
|
||||
"minecraft:spruce_door",
|
||||
"minecraft:birch_door",
|
||||
|
@ -36,12 +36,7 @@
|
||||
public class DoublePlantExtension implements BlockStateExtension {
|
||||
|
||||
private static final Collection<String> AFFECTED_BLOCK_IDS = Lists.newArrayList(
|
||||
"minecraft:sunflower",
|
||||
"minecraft:lilac",
|
||||
"minecraft:tall_grass",
|
||||
"minecraft:large_fern",
|
||||
"minecraft:rose_bush",
|
||||
"minecraft:peony"
|
||||
"minecraft:double_plant"
|
||||
);
|
||||
|
||||
@Override
|
||||
|
@ -35,15 +35,15 @@
|
||||
public class SnowyExtension implements BlockStateExtension {
|
||||
|
||||
private static final Collection<String> AFFECTED_BLOCK_IDS = Lists.newArrayList(
|
||||
"minecraft:grass_block",
|
||||
"minecraft:podzol"
|
||||
"minecraft:grass",
|
||||
"minecraft:mycelium"
|
||||
);
|
||||
|
||||
@Override
|
||||
public BlockState extend(MCAWorld world, Vector3i pos, BlockState state) {
|
||||
BlockState above = world.getBlockState(pos.add(0, 1, 0));
|
||||
|
||||
if (above.getFullId().equals("minecraft:snow") || above.getFullId().equals("minecraft:snow_block")) {
|
||||
if (above.getFullId().equals("minecraft:snow_layer") || above.getFullId().equals("minecraft:snow")) {
|
||||
return state.with("snowy", "true");
|
||||
} else {
|
||||
return state.with("snowy", "false");
|
||||
|
@ -37,7 +37,8 @@
|
||||
public class WallConnectExtension extends ConnectSameOrFullBlockExtension {
|
||||
|
||||
private static final HashSet<String> AFFECTED_BLOCK_IDS = Sets.newHashSet(
|
||||
"minecraft:cobblestone_wall"
|
||||
"minecraft:cobblestone_wall",
|
||||
"minecraft:mossy_cobblestone_wall"
|
||||
);
|
||||
|
||||
@Override
|
||||
|
@ -32,7 +32,7 @@
|
||||
public class WoodenFenceConnectExtension extends ConnectSameOrFullBlockExtension {
|
||||
|
||||
private static final HashSet<String> AFFECTED_BLOCK_IDS = Sets.newHashSet(
|
||||
"minecraft:oak_fence",
|
||||
"minecraft:fence",
|
||||
"minecraft:spruce_fence",
|
||||
"minecraft:birch_fence",
|
||||
"minecraft:jungle_fence",
|
||||
|
@ -93,7 +93,7 @@ public HiresModel render(WorldTile tile, AABB region) {
|
||||
color = MathUtils.overlayColors(blockModel.getMapColor(), color);
|
||||
|
||||
//TODO: quick hack to random offset grass
|
||||
if (block.getBlock().getId().equals("grass")){
|
||||
if (block.getBlock().getFullId().equals("minecraft:tall_grass")){
|
||||
float dx = (MathUtils.hashToFloat(x, y, z, 123984) - 0.5f) * 0.75f;
|
||||
float dz = (MathUtils.hashToFloat(x, y, z, 345542) - 0.5f) * 0.75f;
|
||||
blockModel.translate(new Vector3f(dx, 0, dz));
|
||||
|
@ -105,9 +105,11 @@ public BlockStateModel build(BlockModelResource bmr) {
|
||||
|
||||
int textureId = texture.getId();
|
||||
Vector3f tintcolor = Vector3f.ONE;
|
||||
/* Water is not tinted in 1.12
|
||||
if (liquidBlockState.getFullId().equals("minecraft:water")) {
|
||||
tintcolor = colorCalculator.getWaterAverageColor(block);
|
||||
}
|
||||
*/
|
||||
|
||||
createElementFace(model, Direction.DOWN, c[0], c[2], c[3], c[1], tintcolor, textureId);
|
||||
createElementFace(model, Direction.UP, c[5], c[7], c[6], c[4], tintcolor, textureId);
|
||||
|
@ -388,7 +388,9 @@ private Face buildFace(Element element, Direction direction, ConfigurationNode n
|
||||
String dirString = node.getNode("cullface").getString();
|
||||
if (dirString.equals("bottom")) dirString = "down";
|
||||
if (dirString.equals("top")) dirString = "up";
|
||||
face.cullface = Direction.fromString(dirString);
|
||||
try {
|
||||
face.cullface = Direction.fromString(dirString);
|
||||
} catch (IllegalArgumentException ignore) {}
|
||||
}
|
||||
|
||||
return face;
|
||||
|
@ -168,6 +168,9 @@ public BlockStateResource build(String blockstateFile) throws IOException {
|
||||
String conditionString = entry.getKey().toString();
|
||||
ConfigurationNode transformedModelNode = entry.getValue();
|
||||
|
||||
//some exceptions in 1.12 resource packs that we ignore
|
||||
if (conditionString.equals("all") || conditionString.equals("map")) continue;
|
||||
|
||||
Variant variant = blockState.new Variant();
|
||||
variant.condition = parseConditionString(conditionString);
|
||||
variant.models = loadModels(transformedModelNode, blockstateFile, null);
|
||||
@ -228,7 +231,7 @@ private Weighted<TransformedBlockModelResource> loadModel(ConfigurationNode node
|
||||
if (namespacedModelPath == null)
|
||||
throw new ParseResourceException("No model defined!");
|
||||
|
||||
String modelPath = ResourcePack.namespacedToAbsoluteResourcePath(namespacedModelPath, "models") + ".json";
|
||||
String modelPath = ResourcePack.namespacedToAbsoluteResourcePath(namespacedModelPath, "models/block") + ".json";
|
||||
|
||||
BlockModelResource model = resourcePack.blockModelResources.get(modelPath);
|
||||
if (model == null) {
|
||||
@ -274,6 +277,7 @@ private PropertyCondition parseCondition(ConfigurationNode conditionNode) {
|
||||
|
||||
private PropertyCondition parseConditionString(String conditionString) throws IllegalArgumentException {
|
||||
List<PropertyCondition> conditions = new ArrayList<>();
|
||||
|
||||
if (!conditionString.isEmpty() && !conditionString.equals("default") && !conditionString.equals("normal")) {
|
||||
String[] conditionSplit = StringUtils.split(conditionString, ',');
|
||||
for (String element : conditionSplit) {
|
||||
|
@ -54,8 +54,8 @@
|
||||
*/
|
||||
public class ResourcePack {
|
||||
|
||||
public static final String MINECRAFT_CLIENT_VERSION = "1.14.4";
|
||||
public static final String MINECRAFT_CLIENT_URL = "https://launcher.mojang.com/v1/objects/8c325a0c5bd674dd747d6ebaa4c791fd363ad8a9/client.jar";
|
||||
public static final String MINECRAFT_CLIENT_VERSION = "1.12.2";
|
||||
public static final String MINECRAFT_CLIENT_URL = "https://launcher.mojang.com/v1/objects/0f275bc1547d01fa5f56ba34bdc87d981ee12daf/client.jar";
|
||||
|
||||
private static final String[] CONFIG_FILES = {
|
||||
"blockColors.json",
|
||||
|
@ -1,5 +1,5 @@
|
||||
{
|
||||
"variants": {
|
||||
"": { "model": "block/lava" }
|
||||
"": { "model": "lava" }
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
{
|
||||
"variants": {
|
||||
"": { "model": "block/water" }
|
||||
"": { "model": "water" }
|
||||
}
|
||||
}
|
||||
|
@ -1,8 +1,8 @@
|
||||
{
|
||||
"parent": "builtin/liquid",
|
||||
"textures": {
|
||||
"particle": "block/lava_still",
|
||||
"still": "block/lava_still",
|
||||
"flow": "block/lava_flow"
|
||||
"particle": "blocks/lava_still",
|
||||
"still": "blocks/lava_still",
|
||||
"flow": "blocks/lava_flow"
|
||||
}
|
||||
}
|
@ -1,8 +1,8 @@
|
||||
{
|
||||
"parent": "builtin/liquid",
|
||||
"textures": {
|
||||
"particle": "block/water_still",
|
||||
"still": "block/water_still",
|
||||
"flow": "block/water_flow"
|
||||
"particle": "blocks/water_still",
|
||||
"still": "blocks/water_still",
|
||||
"flow": "blocks/water_flow"
|
||||
}
|
||||
}
|
@ -1,11 +1,11 @@
|
||||
{
|
||||
"default": "@foliage",
|
||||
"minecraft:water": "@water",
|
||||
"minecraft:grass_block": "@grass",
|
||||
"minecraft:grass": "@grass",
|
||||
"minecraft:tall_grass": "@grass",
|
||||
"minecraft:double_grass": "@grass",
|
||||
"minecraft:fern": "@grass",
|
||||
"minecraft:large_fern": "@grass",
|
||||
"minecraft:double_fern": "@grass",
|
||||
"minecraft:redstone_wire": "#ff0000",
|
||||
"minecraft:birch_leaves": "#86a863",
|
||||
"minecraft:spruce_leaves": "#51946b"
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -39,7 +39,7 @@
|
||||
"occluding": true,
|
||||
"flammable": false
|
||||
},
|
||||
"minecraft:grass_block": {
|
||||
"minecraft:grass": {
|
||||
"culling": true,
|
||||
"occluding": true,
|
||||
"flammable": false
|
||||
@ -524,7 +524,7 @@
|
||||
"occluding": false,
|
||||
"flammable": false
|
||||
},
|
||||
"minecraft:grass": {
|
||||
"minecraft:tall_grass": {
|
||||
"culling": false,
|
||||
"occluding": false,
|
||||
"flammable": true
|
||||
@ -2249,7 +2249,7 @@
|
||||
"occluding": false,
|
||||
"flammable": true
|
||||
},
|
||||
"minecraft:tall_grass": {
|
||||
"minecraft:double_grass": {
|
||||
"culling": false,
|
||||
"occluding": false,
|
||||
"flammable": true
|
||||
|
Binary file not shown.
@ -28,7 +28,7 @@ allprojects {
|
||||
|
||||
dependencies {
|
||||
compile project(':BlueMapCLI')
|
||||
//compile project(':BlueMapSponge')
|
||||
compile project(':BlueMapSponge')
|
||||
}
|
||||
|
||||
shadowJar {
|
||||
|
@ -1,8 +1,8 @@
|
||||
rootProject.name = 'BlueMap'
|
||||
include ':BlueMapCore'
|
||||
include ':BlueMapCLI'
|
||||
//include ':BlueMapSponge'
|
||||
include ':BlueMapSponge'
|
||||
|
||||
project(':BlueMapCore').projectDir = "$rootDir/BlueMapCore" as File
|
||||
project(':BlueMapCLI').projectDir = "$rootDir/BlueMapCLI" as File
|
||||
//project(':BlueMapSponge').projectDir = "$rootDir/BlueMapSponge" as File
|
||||
project(':BlueMapSponge').projectDir = "$rootDir/BlueMapSponge" as File
|
Loading…
Reference in New Issue
Block a user