1
mirror of https://github.com/StarWishsama/Slimefun4.git synced 2024-09-20 03:35:51 +00:00

Merge pull request #979 from dniym/TableSaw

Table saw
This commit is contained in:
TheBusyBiscuit 2019-08-03 20:06:05 +02:00 committed by GitHub
commit eec510d32f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 41 additions and 2 deletions

View File

@ -367,7 +367,8 @@ public class SlimefunItems {
public static ItemStack PRESSURE_CHAMBER = new CustomItem(Material.GLASS, "&bPressure Chamber", "", "&a&oCompresses Items even more");
public static ItemStack MAGIC_WORKBENCH = new CustomItem(Material.CRAFTING_TABLE, "&6Magic Workbench", "Infuses Items with magical Energy");
public static ItemStack ORE_WASHER = new CustomItem(Material.CAULDRON, "&6Ore Washer", "", "&a&oWashes Sifted Ore to filter Ores", "&a&oand gives you small Stone Chunks");
public static ItemStack SAW_MILL = new CustomItem(Material.IRON_BARS, "&6Saw Mill", "", "&a&oAllows you to get 8 planks from 1 Log");
public static ItemStack TABLE_SAW = new CustomItem(Material.STONECUTTER, "&6Table Saw", "", "&a&oAllows you get 8 planks from 1 Log", "&a&o(Works with all log types)");
public static ItemStack SAW_MILL = new CustomItem(Material.BARRIER, "&6Saw Mill", "", "&cObsolete! Use the Table Saw instead");
public static ItemStack COMPOSTER = new CustomItem(Material.CAULDRON, "&aComposter", "", "&a&oCan convert various Materials over Time...");
public static ItemStack ENHANCED_CRAFTING_TABLE = new CustomItem(Material.CRAFTING_TABLE, "&eEnhanced Crafting Table", "", "&a&oA regular Crafting Table cannot", "&a&ohold this massive Amount of Power...");
public static ItemStack CRUCIBLE = new CustomItem(Material.CAULDRON, "&cCrucible", "", "&a&oUsed to smelt Items into Liquids");

View File

@ -94,7 +94,7 @@ public class ResearchSetup {
Slimefun.registerResearch(new Research(89, "Night Vision Goggles", 10), SlimefunItems.NIGHT_VISION_GOGGLES);
Slimefun.registerResearch(new Research(90, "Pickaxe of Containment", 14), SlimefunItems.PICKAXE_OF_CONTAINMENT, SlimefunItems.BROKEN_SPAWNER);
Slimefun.registerResearch(new Research(91, "Hercules Pickaxe", 28), SlimefunItems.HERCULES_PICKAXE);
Slimefun.registerResearch(new Research(92, "Saw Mill", 2), SlimefunItems.SAW_MILL);
Slimefun.registerResearch(new Research(92, "Table Saw", 2), SlimefunItems.SAW_MILL, SlimefunItems.TABLE_SAW);
Slimefun.registerResearch(new Research(93, "Slimy Steel Armor", 27), SlimefunItems.SLIME_HELMET_STEEL, SlimefunItems.SLIME_CHESTPLATE_STEEL, SlimefunItems.SLIME_LEGGINGS_STEEL, SlimefunItems.SLIME_BOOTS_STEEL);
Slimefun.registerResearch(new Research(94, "Blade of Vampires", 26), SlimefunItems.BLADE_OF_VAMPIRES);
Slimefun.registerResearch(new Research(95, "Lazy Mining", 40), SlimefunItems.DIGITAL_MINER);

View File

@ -1875,7 +1875,45 @@ public class SlimefunSetup {
else return false;
}
});
new SlimefunMachine(Categories.MACHINES_1, SlimefunItems.TABLE_SAW, "TABLE_SAW",
new ItemStack[] {null, null, null, new ItemStack(Material.STONE_SLAB), new ItemStack(Material.STONECUTTER), new ItemStack(Material.STONE_SLAB), null, new ItemStack(Material.IRON_BLOCK), null},
new ItemStack[] {}, Material.STONECUTTER)
.register(true, new MultiBlockInteractionHandler() {
@Override
public boolean onInteract(Player p, MultiBlock mb, Block b) {
if (mb.isMultiBlock(SlimefunItem.getByID("TABLE_SAW"))) {
if (CSCoreLib.getLib().getProtectionManager().canBuild(p.getUniqueId(), b.getRelative(BlockFace.UP), true)) {
if (Slimefun.hasUnlocked(p, SlimefunItems.TABLE_SAW, true)) {
if(p.getInventory().getItemInMainHand() != null && Tag.LOGS.getValues().contains(p.getInventory().getItemInMainHand().getType())) {
ItemStack log = p.getInventory().getItemInMainHand();
ItemStack item = new ItemStack(MaterialHelper.getWoodFromLog(log.getType()), 8);
b.getWorld().dropItemNaturally(b.getLocation(), item);
b.getWorld().playEffect(b.getLocation(), Effect.STEP_SOUND, log.getType());
log.setAmount(log.getAmount() -1);
if(log.getAmount() <= 0)
p.getInventory().setItemInMainHand(new ItemStack(Material.AIR));
}
}
}
return true;
}
else return false;
}
});
/*
* dNiym 7/30/2019 added the Table_Saw machine to replace the Saw_mill, as the sawmill's design does not work with
* the new types of log's in minecraft. Now that there are multiple types with their own object ID the existing
* way of detecting multi blocks limits us to using specific material types in a build, therefore having a block that
* needs to change like for the sawmill is not possible to do without major overhauling of multiblocks. The Saw_Mill
* machine has been left in as to not break machines on existing servers however it should no longer show up in the
* slimefun guide.
*/
new SlimefunMachine(Categories.MACHINES_1, SlimefunItems.SAW_MILL, "SAW_MILL",
new ItemStack[] {null, null, null, new ItemStack(Material.IRON_BARS), new ItemStack(Material.OAK_LOG), new ItemStack(Material.IRON_BARS), new ItemStack(Material.OAK_LOG), new ItemStack(Material.CRAFTING_TABLE), new ItemStack(Material.OAK_LOG)},
new ItemStack[] {}, Material.CRAFTING_TABLE)