Skip to content

Commit

Permalink
Merge branch 'master' into feature/sound-manager
Browse files Browse the repository at this point in the history
  • Loading branch information
WalshyDev committed Jun 21, 2023
2 parents f98ffe9 + 379cb97 commit ec4cfe3
Show file tree
Hide file tree
Showing 10 changed files with 562 additions and 40 deletions.
20 changes: 18 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Table of contents
- [Release Candidate 34 (TBD)](#release-candidate-34-tbd)
- [Release Candidate 35 (TBD)](#release-candidate-35-tbd)
- [Release Candidate 34 (20 Jun 2023)](#release-candidate-34-20-jun-2023)
- [Release Candidate 33 (07 Jan 2023)](#release-candidate-33-07-jan-2023)
- [Release Candidate 32 (26 Jun 2022)](#release-candidate-32-26-jun-2022)
- [Release Candidate 31 (14 Mar 2022)](#release-candidate-31-14-mar-2022)
Expand Down Expand Up @@ -34,8 +35,16 @@
- [Release Candidate 2 (29 Sep 2019)](#release-candidate-2-29-sep-2019)
- [Release Candidate 1 (26 Sep 2019)](#release-candidate-1-26-sep-2019)

## Release Candidate 35 (TBD)

## Release Candidate 34 (TBD)
#### Additions

#### Changes

#### Fixes

## Release Candidate 34 (20 Jun 2023)
https://thebusybiscuit.github.io/builds/TheBusyBiscuit/Slimefun4/stable/#34

#### Additions
* Added "Cobbled Deepslate -> Gravel" recipe to the Grind Stone
Expand All @@ -45,6 +54,7 @@
* (API) Added EnergyNet#getConsumers()
* Added Bamboo as a fuel type for Tier 1 Androids
* Added "Basalt -> Blackstone" recipe to the Grind Stone
* Added a way to automate salt with the Ore Washer
* Added compatibility for Minecraft 1.20

#### Changes
Expand All @@ -57,6 +67,7 @@
* Tuff
* Clay
* Skulk
* Lumber Axe no longer works when shifting

#### Fixes
* Fixed #3741
Expand All @@ -67,6 +78,11 @@
* Fixed #3361
* Fixed #3254
* Fixed #3443
* Fixed #3511
* Fixed #3524
* Fixed #3657
* Fixed #3768
* Fixed #3414

## Release Candidate 33 (07 Jan 2023)
https://thebusybiscuit.github.io/builds/TheBusyBiscuit/Slimefun4/stable/#33
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Here is a full summary of the differences between the two different versions of

| | development (latest) | "stable" |
| ------------------ | -------- | -------- |
| **Minecraft version(s)** | :video_game: **1.16.\* - 1.20.\*** | :video_game: **1.14.\* - 1.19.\*** |
| **Minecraft version(s)** | :video_game: **1.16.\* - 1.20.\*** | :video_game: **1.14.\* - 1.20.\*** |
| **Java version** | :computer: **Java 16 (or higher)** | :computer: **Java 16 (or higher)** |
| **automatic updates** | :heavy_check_mark: | :heavy_check_mark: |
| **frequent updates** | :heavy_check_mark: | :x: |
Expand Down
12 changes: 6 additions & 6 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@
<!-- Dependency shading -->
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.4.1</version>
<version>3.5.0</version>

<configuration>
<!-- Relocate these to avoid clashes and conflicts -->
Expand Down Expand Up @@ -389,7 +389,7 @@
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>5.3.1</version>
<version>5.4.0</version>
<scope>test</scope>
</dependency>
<dependency>
Expand Down Expand Up @@ -418,7 +418,7 @@
<dependency>
<groupId>com.sk89q.worldedit</groupId>
<artifactId>worldedit-core</artifactId>
<version>7.2.14</version>
<version>7.2.15</version>
<scope>provided</scope>

<exclusions>
Expand All @@ -432,7 +432,7 @@
<dependency>
<groupId>com.sk89q.worldedit</groupId>
<artifactId>worldedit-bukkit</artifactId>
<version>7.2.14</version>
<version>7.2.15</version>
<scope>provided</scope>

<exclusions>
Expand All @@ -446,7 +446,7 @@
<dependency>
<groupId>com.gmail.nossr50.mcMMO</groupId>
<artifactId>mcMMO</artifactId>
<version>2.1.220</version>
<version>2.1.221</version>
<scope>provided</scope>

<exclusions>
Expand Down Expand Up @@ -488,7 +488,7 @@
<dependency>
<groupId>com.github.LoneDev6</groupId>
<artifactId>itemsadder-api</artifactId>
<version>3.4.1-r4</version>
<version>3.5.0b</version>
<scope>provided</scope>

<exclusions>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
package io.github.thebusybiscuit.slimefun4.api.events;

import javax.annotation.Nonnull;
import javax.annotation.ParametersAreNonnullByDefault;

import org.bukkit.block.Block;
import org.bukkit.entity.Player;
import org.bukkit.event.Cancellable;
import org.bukkit.event.Event;
import org.bukkit.event.HandlerList;
import org.bukkit.event.block.BlockEvent;
import org.bukkit.inventory.ItemStack;

import io.github.thebusybiscuit.slimefun4.api.items.SlimefunItem;

/**
* This {@link Event} is fired whenever a {@link SlimefunItem} placed as a {@link Block} in the world is broken.
*
* @author J3fftw1
*/
public class SlimefunBlockBreakEvent extends Event implements Cancellable {

private static final HandlerList handlers = new HandlerList();

private final Block blockBroken;
private final SlimefunItem slimefunItem;
private final ItemStack heldItem;
private final Player player;

private boolean cancelled = false;

/**
* @param player
* The {@link Player} who broke this {@link SlimefunItem}
* @param heldItem
* The {@link ItemStack} held by the {@link Player}
* @param blockBroken
* The {@link Block} broken by the {@link Player}
* @param slimefunItem
* The {@link SlimefunItem} within the {@link ItemStack}
*/
@ParametersAreNonnullByDefault
public SlimefunBlockBreakEvent(Player player, ItemStack heldItem, Block blockBroken, SlimefunItem slimefunItem) {
super();

this.player = player;
this.heldItem = heldItem;
this.blockBroken = blockBroken;
this.slimefunItem = slimefunItem;
}

/**
* This gets the broken {@link Block}
*
* @return The broken {@link Block}
*/
public @Nonnull Block getBlockBroken() {
return blockBroken;
}

/**
* This gets the {@link SlimefunItem} being broken
*
* @return The {@link SlimefunItem} being broken
*/
public @Nonnull SlimefunItem getSlimefunItem() {
return slimefunItem;
}

/**
* The {@link ItemStack} held by the {@link Player}
*
* @return The held {@link ItemStack}
*/
public @Nonnull ItemStack getHeldItem() {
return heldItem;
}

/**
* This gets the {@link Player}
*
* @return The {@link Player}
*/
public @Nonnull Player getPlayer() {
return player;
}

@Override
public boolean isCancelled() {
return cancelled;
}

@Override
public void setCancelled(boolean cancelled) {
this.cancelled = cancelled;
}

public static @Nonnull HandlerList getHandlerList() {
return handlers;
}

@Override
public @Nonnull HandlerList getHandlers() {
return getHandlerList();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
package io.github.thebusybiscuit.slimefun4.api.events;

import javax.annotation.Nonnull;
import javax.annotation.ParametersAreNonnullByDefault;

import org.bukkit.block.Block;
import org.bukkit.entity.Player;
import org.bukkit.event.Cancellable;
import org.bukkit.event.Event;
import org.bukkit.event.HandlerList;
import org.bukkit.inventory.ItemStack;

import io.github.thebusybiscuit.slimefun4.api.items.SlimefunItem;

/**
* This {@link Event} is fired whenever a {@link SlimefunItem} is placed as a {@link Block} in the world.
*
* @author J3fftw1
*/
public class SlimefunBlockPlaceEvent extends Event implements Cancellable {

private static final HandlerList handlers = new HandlerList();

private final Block blockPlaced;
private final SlimefunItem slimefunItem;
private final ItemStack placedItem;
private final Player player;

private boolean cancelled = false;

/**
* @param player
* The {@link Player} who placed this {@link SlimefunItem}
* @param placedItem
* The {@link ItemStack} held by the {@link Player}
* @param blockPlaced
* The {@link Block} placed by the {@link Player}
* @param slimefunItem
* The {@link SlimefunItem} within the {@link ItemStack}
*/
@ParametersAreNonnullByDefault
public SlimefunBlockPlaceEvent(Player player, ItemStack placedItem, Block blockPlaced, SlimefunItem slimefunItem) {
super();

this.player = player;
this.placedItem = placedItem;
this.blockPlaced = blockPlaced;
this.slimefunItem = slimefunItem;
}

/**
* This gets the placed {@link Block}
*
* @return The placed {@link Block}
*/
public @Nonnull Block getBlockPlaced() {
return blockPlaced;
}

/**
* This gets the {@link SlimefunItem} being placed
*
* @return The {@link SlimefunItem} being placed
*/
public @Nonnull SlimefunItem getSlimefunItem() {
return slimefunItem;
}

/**
* This gets the placed {@link ItemStack}.
*
* @return The placed {@link ItemStack}
*/
public @Nonnull ItemStack getItemStack() {
return placedItem;
}

/**
* This gets the {@link Player}
*
* @return The {@link Player}
*/
public @Nonnull Player getPlayer() {
return player;
}

@Override
public boolean isCancelled() {
return cancelled;
}

@Override
public void setCancelled(boolean cancelled) {
this.cancelled = cancelled;
}

public static @Nonnull HandlerList getHandlerList() {
return handlers;
}

@Override
public @Nonnull HandlerList getHandlers() {
return getHandlerList();
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package io.github.thebusybiscuit.slimefun4.implementation.items.electric.machines;

import javax.annotation.Nonnull;
import javax.annotation.ParametersAreNonnullByDefault;

import org.bukkit.Material;
Expand Down Expand Up @@ -45,25 +46,28 @@ public ItemStack getProgressBar() {
@Override
protected MachineRecipe findNextRecipe(BlockMenu menu) {
for (int slot : getInputSlots()) {
if (SlimefunUtils.isItemSimilar(menu.getItemInSlot(slot), SlimefunItems.SIFTED_ORE, true, false)) {
ItemStack input = menu.getItemInSlot(slot);
MachineRecipe recipe = null;
if (SlimefunUtils.isItemSimilar(input, SlimefunItems.SIFTED_ORE, true, false)) {
if (!legacyMode && !hasFreeSlot(menu)) {
return null;
}

ItemStack dust = oreWasher.getRandomDust();
MachineRecipe recipe = new MachineRecipe(4 / getSpeed(), new ItemStack[] { SlimefunItems.SIFTED_ORE }, new ItemStack[] { dust });
recipe = new MachineRecipe(4 / getSpeed(), new ItemStack[] { SlimefunItems.SIFTED_ORE }, new ItemStack[] { oreWasher.getRandomDust() });

if (!legacyMode || menu.fits(recipe.getOutput()[0], getOutputSlots())) {
menu.consumeItem(slot);
return recipe;
}
} else if (SlimefunUtils.isItemSimilar(menu.getItemInSlot(slot), SlimefunItems.PULVERIZED_ORE, true)) {
MachineRecipe recipe = new MachineRecipe(4 / getSpeed(), new ItemStack[] { SlimefunItems.PULVERIZED_ORE }, new ItemStack[] { SlimefunItems.PURE_ORE_CLUSTER });
} else if (SlimefunUtils.isItemSimilar(input, SlimefunItems.PULVERIZED_ORE, true)) {
recipe = new MachineRecipe(4 / getSpeed(), new ItemStack[] { SlimefunItems.PULVERIZED_ORE }, new ItemStack[] { SlimefunItems.PURE_ORE_CLUSTER });
} else if (SlimefunUtils.isItemSimilar(input, new ItemStack(Material.SAND), true)) {
recipe = new MachineRecipe(4 / getSpeed(), new ItemStack[] { new ItemStack(Material.SAND) }, new ItemStack[] { SlimefunItems.SALT });
}

if (menu.fits(recipe.getOutput()[0], getOutputSlots())) {
menu.consumeItem(slot);
return recipe;
}
if (recipe != null && menu.fits(recipe.getOutput()[0], getOutputSlots())) {
menu.consumeItem(slot);
return recipe;
}
}

Expand All @@ -83,7 +87,7 @@ private boolean hasFreeSlot(BlockMenu menu) {
}

@Override
public String getMachineIdentifier() {
public @Nonnull String getMachineIdentifier() {
return "ELECTRIC_DUST_WASHER";
}

Expand Down
Loading

0 comments on commit ec4cfe3

Please sign in to comment.