Skip to content

Commit

Permalink
Update Auto-Smelt and Beheading with 1.20 Blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
Flo56958 committed Jun 8, 2023
1 parent 76f3112 commit 43274b0
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 2 deletions.
5 changes: 5 additions & 0 deletions src/main/java/de/flo56958/minetinker/MineTinker.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ public class MineTinker extends JavaPlugin {
private static JavaPlugin plugin;
public static boolean is18compatible;
public static boolean is19compatible;
public static boolean is20compatible;

@Contract(pure = true)
public static JavaPlugin getPlugin() { // necessary to do getConfig() in other classes
Expand All @@ -45,6 +46,7 @@ private void parseMCVersion() {

is18compatible = mayor >= 1 && minor >= 18;
is19compatible = mayor >= 1 && minor >= 19;
is20compatible = mayor >= 1 && minor >= 20;
} catch (Exception e) {
e.printStackTrace();
ChatWriter.logError("Could not parse the Minecraft Version! Running 1.17 feature set. " +
Expand All @@ -57,6 +59,9 @@ private void parseMCVersion() {
if (is19compatible) {
ChatWriter.log(false, "1.19 enhanced features activated!");
}
if (is20compatible) {
ChatWriter.log(false, "1.20 enhanced features activated!");
}
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ public void onToolLevelUp(@NotNull final ToolLevelUpEvent event) {
config.getBoolean("LevelUpEvents.AppliedModifiersConsiderSlots"));
}
if (!appliedRandomMod) {
mods.remove(index); //Remove the failed modifier from the the list of the possibles
mods.remove(index); //Remove the failed modifier from the list of the possibles
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public void onTridentLaunch(@NotNull final ProjectileLaunchEvent event) {
}

ModManager.instance().addExp(player, trident, -5_000_000, true);
//trident is a item clone and only for triggering modifier effects
//trident is an item clone and only for triggering modifier effects
//this makes sure that the item duplicate does not get any level ups
TridentToItemStack.put((Trident) event.getEntity(), trident);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,24 @@ public void reload() {
conversions.put(Material.MUD, new Triplet(Material.CLAY, 1));
}

if (MineTinker.is20compatible) {
conversions.put(Material.CHERRY_LEAVES, new Triplet(Material.STICK, 1));
conversions.put(Material.CHERRY_LOG, new Triplet(Material.CHARCOAL, 1));
conversions.put(Material.STRIPPED_CHERRY_LOG, new Triplet(Material.CHARCOAL, 1));
conversions.put(Material.CHERRY_WOOD, new Triplet(Material.CHARCOAL, 1));
conversions.put(Material.STRIPPED_CHERRY_WOOD, new Triplet(Material.CHARCOAL, 1));

conversions.put(Material.BAMBOO_BLOCK, new Triplet(Material.CHARCOAL, 1));

conversions.put(Material.SUSPICIOUS_SAND, new Triplet(Material.GLASS, 1));
}

for (Material m : Material.values()) {
if (m.isBurnable()) {
conversions.putIfAbsent(m, new Triplet(Material.AIR, 1));
}
}

//Saving Conversions as String
Map<String, String> conversionsSTR = new HashMap<>();
conversions.forEach((k, v) -> conversionsSTR.put(k.toString(), v.toString()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,8 @@ public void effect(MTEntityDeathEvent event) {
}

loot = head;
} else if (MineTinker.is20compatible && mob.getType() == EntityType.PIGLIN) {
loot = new ItemStack(Material.PIGLIN_HEAD, 1);
}

if (loot.getType() != Material.AIR) {
Expand Down

0 comments on commit 43274b0

Please sign in to comment.