From f20b40fb80aabdf577d636108bda0fc279432f43 Mon Sep 17 00:00:00 2001 From: RainWarrior Date: Tue, 10 Nov 2015 00:42:56 +0300 Subject: [PATCH] Fix generics and error in the BlockState patch. --- .../net/minecraft/block/state/BlockState.java.patch | 8 ++++---- .../common/property/ExtendedBlockState.java | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/patches/minecraft/net/minecraft/block/state/BlockState.java.patch b/patches/minecraft/net/minecraft/block/state/BlockState.java.patch index e2a202b48..5d82d564b 100644 --- a/patches/minecraft/net/minecraft/block/state/BlockState.java.patch +++ b/patches/minecraft/net/minecraft/block/state/BlockState.java.patch @@ -7,12 +7,12 @@ + this(blockIn, properties, null); + } + -+ protected StateImplementation createState(Block block, ImmutableMap properties, ImmutableMap unlistedProperties) ++ protected StateImplementation createState(Block block, ImmutableMap properties, ImmutableMap, com.google.common.base.Optional> unlistedProperties) + { + return new StateImplementation(block, properties); + } + -+ protected BlockState(Block blockIn, IProperty[] properties, ImmutableMap unlistedProperties) ++ protected BlockState(Block blockIn, IProperty[] properties, ImmutableMap, com.google.common.base.Optional> unlistedProperties) + { this.block = blockIn; Arrays.sort(properties, new Comparator() @@ -22,7 +22,7 @@ { Map map1 = MapPopulator.createMap(this.properties, list1); - BlockState.StateImplementation blockstate$stateimplementation = new BlockState.StateImplementation(blockIn, ImmutableMap.copyOf(map1)); -+ BlockState.StateImplementation blockstate$stateimplementation = createState(blockIn, ImmutableMap.copyOf(map), unlistedProperties); ++ BlockState.StateImplementation blockstate$stateimplementation = createState(blockIn, ImmutableMap.copyOf(map1), unlistedProperties); map.put(map1, blockstate$stateimplementation); list.add(blockstate$stateimplementation); } @@ -30,7 +30,7 @@ } } -+ protected StateImplementation(Block blockIn, ImmutableMap propertiesIn, ImmutableTable propertyValueTable) ++ protected StateImplementation(Block blockIn, ImmutableMap propertiesIn, ImmutableTable propertyValueTable) + { + this.block = blockIn; + this.properties = propertiesIn; diff --git a/src/main/java/net/minecraftforge/common/property/ExtendedBlockState.java b/src/main/java/net/minecraftforge/common/property/ExtendedBlockState.java index c299e3fa5..a0b5a318f 100644 --- a/src/main/java/net/minecraftforge/common/property/ExtendedBlockState.java +++ b/src/main/java/net/minecraftforge/common/property/ExtendedBlockState.java @@ -56,7 +56,7 @@ public class ExtendedBlockState extends BlockState private final ImmutableMap, Optional> unlistedProperties; private Map, IBlockState> normalMap; - protected ExtendedStateImplementation(Block block, ImmutableMap properties, ImmutableMap, Optional> unlistedProperties, ImmutableTable table) + protected ExtendedStateImplementation(Block block, ImmutableMap properties, ImmutableMap, Optional> unlistedProperties, ImmutableTable table) { super(block, properties); this.unlistedProperties = unlistedProperties; @@ -64,7 +64,7 @@ public class ExtendedBlockState extends BlockState } @Override - public IBlockState withProperty(IProperty property, Comparable value) + public , V extends T> IBlockState withProperty(IProperty property, V value) { if (!this.getProperties().containsKey(property)) {