Skip to content

Commit

Permalink
feat(brewer): add new potion in 1.21
Browse files Browse the repository at this point in the history
  • Loading branch information
StarWishsama committed Dec 22, 2024
1 parent 3d3fade commit 1318ae9
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import city.norain.slimefun4.api.menu.UniversalMenu;
import city.norain.slimefun4.utils.TaskUtil;
import com.google.common.base.Preconditions;
import com.xzavier0722.mc.plugin.slimefun4.storage.callback.IAsyncReadCallback;
import com.xzavier0722.mc.plugin.slimefun4.storage.controller.ADataContainer;
import com.xzavier0722.mc.plugin.slimefun4.storage.controller.ASlimefunDataContainer;
Expand Down Expand Up @@ -96,8 +95,10 @@ public static void setData(Location loc, String key, String val) {
block.setData(key, val);
} else {
var uni = getUniversalBlock(loc.getBlock());
Preconditions.checkNotNull(uni);
uni.setData(key, val);

if (uni != null) {
uni.setData(key, val);
}
}
}

Expand All @@ -108,8 +109,10 @@ public static void removeData(Location loc, String key) {
block.removeData(key);
} else {
var uni = getUniversalBlock(loc.getBlock());
Preconditions.checkNotNull(uni);
uni.removeData(key);

if (uni != null) {
uni.removeData(key);
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -877,6 +877,7 @@ protected void rotate(Block b, BlockFace current, int mod) {
rotatable.setRotation(rotation.getOppositeFace());
}
}));

StorageCacheUtils.setData(b.getLocation(), "rotation", rotation.name());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,13 @@ public class AutoBrewer extends AContainer implements NotHopperable {
fermentations.put(VersionedPotionType.HEALING, VersionedPotionType.HARMING);
fermentations.put(PotionType.POISON, VersionedPotionType.HARMING);
fermentations.put(PotionType.NIGHT_VISION, PotionType.INVISIBILITY);

if (SlimefunExtended.getMinecraftVersion().isAtLeast(1, 21)) {
potionRecipes.put(Material.BREEZE_ROD, PotionType.WIND_CHARGED);
potionRecipes.put(Material.COBWEB, PotionType.WEAVING);
potionRecipes.put(Material.SLIME_BLOCK, PotionType.OOZING);
potionRecipes.put(Material.STONE, PotionType.INFESTED);
}
}

@ParametersAreNonnullByDefault
Expand Down

0 comments on commit 1318ae9

Please sign in to comment.