From 07abe31ea422f1c06b7ed36e42bfd3bf15a36769 Mon Sep 17 00:00:00 2001 From: Meredith Espinosa Date: Tue, 18 Jun 2019 23:03:32 -0700 Subject: [PATCH] oh right block states are immutable --- .../github/cottonmc/slopetest/util/BlockStateUtil.java | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/main/java/io/github/cottonmc/slopetest/util/BlockStateUtil.java b/src/main/java/io/github/cottonmc/slopetest/util/BlockStateUtil.java index 75dd567..36b079d 100644 --- a/src/main/java/io/github/cottonmc/slopetest/util/BlockStateUtil.java +++ b/src/main/java/io/github/cottonmc/slopetest/util/BlockStateUtil.java @@ -18,7 +18,7 @@ public class BlockStateUtil { BlockState state = factory.getDefaultState(); for (String key : properties.getKeys()) { Property prop = factory.getProperty(key); - if (prop != null) parseProperty(state, prop, properties.getString(key)); + if (prop != null) state = parseProperty(state, prop, properties.getString(key)); } return state; } @@ -34,13 +34,11 @@ public class BlockStateUtil { return tag; } - public static > void parseProperty(BlockState state, Property property, String value) { - System.out.println(value); + public static > BlockState parseProperty(BlockState state, Property property, String value) { Optional optional = property.getValue(value); if (optional.isPresent()) { - System.out.println(optional.get()); - state.with(property, optional.get()); - System.out.println(state.get(property)); + state = state.with(property, optional.get()); } + return state; } }