mirror of
https://github.com/Sollace/Unicopia.git
synced 2025-02-01 19:46:42 +01:00
Fixed apple trees only producing rotten apples
This commit is contained in:
parent
cfd7cf23da
commit
ff7c400885
3 changed files with 2 additions and 14 deletions
|
@ -66,7 +66,7 @@ public class UBlocks {
|
||||||
public static final Block apple_leaves = new BlockFruitLeaves(Unicopia.MODID, "apple_leaves", apple_tree)
|
public static final Block apple_leaves = new BlockFruitLeaves(Unicopia.MODID, "apple_leaves", apple_tree)
|
||||||
.setBaseGrowthChance(1200)
|
.setBaseGrowthChance(1200)
|
||||||
.setTint(0xFFEE81)
|
.setTint(0xFFEE81)
|
||||||
.setHarvestFruit(w -> ItemApple.getRandomItemStack(null))
|
.setHarvestFruit(ItemApple::getRandomItemStack)
|
||||||
.setUnharvestFruit(w -> new ItemStack(UItems.rotten_apple));
|
.setUnharvestFruit(w -> new ItemStack(UItems.rotten_apple));
|
||||||
|
|
||||||
static void init(IForgeRegistry<Block> registry) {
|
static void init(IForgeRegistry<Block> registry) {
|
||||||
|
|
|
@ -57,14 +57,6 @@ public class ItemApple extends ItemFood implements IEdible {
|
||||||
.orElse(ItemStack.EMPTY);
|
.orElse(ItemStack.EMPTY);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ItemStack getRandomApple() {
|
|
||||||
return getRandomApple(null);
|
|
||||||
}
|
|
||||||
|
|
||||||
public ItemStack getRandomApple(Object variant) {
|
|
||||||
return getRandomItemStack(variant);
|
|
||||||
}
|
|
||||||
|
|
||||||
public ItemApple(String domain, String name) {
|
public ItemApple(String domain, String name) {
|
||||||
super(4, 3, false);
|
super(4, 3, false);
|
||||||
|
|
||||||
|
|
|
@ -31,7 +31,7 @@ public class Pool<K, V> extends HashMap<K, V> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public V get(Object key) {
|
public V get(Object key) {
|
||||||
if (!containsKey(key)) {
|
if (key == null || !containsKey(key)) {
|
||||||
key = defaultKey;
|
key = defaultKey;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -39,10 +39,6 @@ public class Pool<K, V> extends HashMap<K, V> {
|
||||||
}
|
}
|
||||||
|
|
||||||
public Optional<V> getOptional(K key) {
|
public Optional<V> getOptional(K key) {
|
||||||
if (!containsKey(key)) {
|
|
||||||
return Optional.empty();
|
|
||||||
}
|
|
||||||
|
|
||||||
return Optional.ofNullable(get(key));
|
return Optional.ofNullable(get(key));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue