mirror of
https://github.com/StarWishsama/Slimefun4.git
synced 2024-09-19 19:25:48 +00:00
Fixes #2424
This commit is contained in:
parent
3b7dd68164
commit
612aad5d95
@ -78,6 +78,8 @@
|
|||||||
* Fixed #2433
|
* Fixed #2433
|
||||||
* Fixed #2455
|
* Fixed #2455
|
||||||
* Fixed #2450
|
* Fixed #2450
|
||||||
|
* Fixed Steel Thrusters being used to milk cows
|
||||||
|
* Fixed #2424
|
||||||
|
|
||||||
## Release Candidate 16 (07 Sep 2020)
|
## Release Candidate 16 (07 Sep 2020)
|
||||||
https://thebusybiscuit.github.io/builds/TheBusyBiscuit/Slimefun4/stable/#16
|
https://thebusybiscuit.github.io/builds/TheBusyBiscuit/Slimefun4/stable/#16
|
||||||
|
@ -94,7 +94,7 @@ abstract class GitHubConnector {
|
|||||||
}
|
}
|
||||||
} catch (UnirestException e) {
|
} catch (UnirestException e) {
|
||||||
if (github.isLoggingEnabled()) {
|
if (github.isLoggingEnabled()) {
|
||||||
Slimefun.getLogger().log(Level.WARNING, "Could not connect to GitHub in time.");
|
Slimefun.getLogger().log(Level.WARNING, "Could not connect to GitHub in time.", e);
|
||||||
}
|
}
|
||||||
|
|
||||||
// It has the cached file, let's just read that then
|
// It has the cached file, let's just read that then
|
||||||
|
@ -88,7 +88,7 @@ class GitHubTask implements Runnable {
|
|||||||
} catch (IOException x) {
|
} catch (IOException x) {
|
||||||
// Too many requests
|
// Too many requests
|
||||||
Slimefun.getLogger().log(Level.WARNING, "Attempted to connect to mojang.com, got this response: {0}: {1}", new Object[] { x.getClass().getSimpleName(), x.getMessage() });
|
Slimefun.getLogger().log(Level.WARNING, "Attempted to connect to mojang.com, got this response: {0}: {1}", new Object[] { x.getClass().getSimpleName(), x.getMessage() });
|
||||||
Slimefun.getLogger().log(Level.WARNING, "This usually means mojang.com is down or started to rate-limit this connection, this is not an error message!");
|
Slimefun.getLogger().log(Level.WARNING, "This usually means mojang.com is temporarily down or started to rate-limit this connection, this is not an error message!");
|
||||||
|
|
||||||
// Retry after 5 minutes if it was rate-limiting
|
// Retry after 5 minutes if it was rate-limiting
|
||||||
if (x.getMessage().contains("429")) {
|
if (x.getMessage().contains("429")) {
|
||||||
|
@ -0,0 +1,41 @@
|
|||||||
|
package io.github.thebusybiscuit.slimefun4.implementation.items.misc;
|
||||||
|
|
||||||
|
import javax.annotation.Nonnull;
|
||||||
|
import javax.annotation.ParametersAreNonnullByDefault;
|
||||||
|
|
||||||
|
import org.bukkit.entity.Cow;
|
||||||
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
|
||||||
|
import io.github.thebusybiscuit.slimefun4.api.events.PlayerRightClickEvent;
|
||||||
|
import io.github.thebusybiscuit.slimefun4.core.handlers.EntityInteractHandler;
|
||||||
|
import io.github.thebusybiscuit.slimefun4.core.handlers.ItemUseHandler;
|
||||||
|
import me.mrCookieSlime.Slimefun.Lists.RecipeType;
|
||||||
|
import me.mrCookieSlime.Slimefun.Objects.Category;
|
||||||
|
import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem;
|
||||||
|
import me.mrCookieSlime.Slimefun.api.SlimefunItemStack;
|
||||||
|
|
||||||
|
public class SteelThruster extends SlimefunItem {
|
||||||
|
|
||||||
|
@ParametersAreNonnullByDefault
|
||||||
|
public SteelThruster(Category category, SlimefunItemStack item, RecipeType recipeType, ItemStack[] recipe) {
|
||||||
|
super(category, item, recipeType, recipe);
|
||||||
|
|
||||||
|
addItemHandler(onRightClickBlock(), onRightClickEntity());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Nonnull
|
||||||
|
private ItemUseHandler onRightClickBlock() {
|
||||||
|
return PlayerRightClickEvent::cancel;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Nonnull
|
||||||
|
private EntityInteractHandler onRightClickEntity() {
|
||||||
|
return (e, item, hand) -> {
|
||||||
|
// Milking cows with a rocket engine? Yeah, that would be weird.
|
||||||
|
if (e.getRightClicked() instanceof Cow) {
|
||||||
|
e.setCancelled(true);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -151,6 +151,7 @@ import io.github.thebusybiscuit.slimefun4.implementation.items.misc.BasicCircuit
|
|||||||
import io.github.thebusybiscuit.slimefun4.implementation.items.misc.CoolantCell;
|
import io.github.thebusybiscuit.slimefun4.implementation.items.misc.CoolantCell;
|
||||||
import io.github.thebusybiscuit.slimefun4.implementation.items.misc.OrganicFertilizer;
|
import io.github.thebusybiscuit.slimefun4.implementation.items.misc.OrganicFertilizer;
|
||||||
import io.github.thebusybiscuit.slimefun4.implementation.items.misc.OrganicFood;
|
import io.github.thebusybiscuit.slimefun4.implementation.items.misc.OrganicFood;
|
||||||
|
import io.github.thebusybiscuit.slimefun4.implementation.items.misc.SteelThruster;
|
||||||
import io.github.thebusybiscuit.slimefun4.implementation.items.misc.StrangeNetherGoo;
|
import io.github.thebusybiscuit.slimefun4.implementation.items.misc.StrangeNetherGoo;
|
||||||
import io.github.thebusybiscuit.slimefun4.implementation.items.misc.SyntheticEmerald;
|
import io.github.thebusybiscuit.slimefun4.implementation.items.misc.SyntheticEmerald;
|
||||||
import io.github.thebusybiscuit.slimefun4.implementation.items.multiblocks.ArmorForge;
|
import io.github.thebusybiscuit.slimefun4.implementation.items.multiblocks.ArmorForge;
|
||||||
@ -608,7 +609,7 @@ public final class SlimefunItemSetup {
|
|||||||
new ItemStack[] {SlimefunItems.COMPRESSED_CARBON, SlimefunItems.COMPRESSED_CARBON, SlimefunItems.COMPRESSED_CARBON, SlimefunItems.COMPRESSED_CARBON, new ItemStack(Material.FLINT), SlimefunItems.COMPRESSED_CARBON, SlimefunItems.COMPRESSED_CARBON, SlimefunItems.COMPRESSED_CARBON, SlimefunItems.COMPRESSED_CARBON})
|
new ItemStack[] {SlimefunItems.COMPRESSED_CARBON, SlimefunItems.COMPRESSED_CARBON, SlimefunItems.COMPRESSED_CARBON, SlimefunItems.COMPRESSED_CARBON, new ItemStack(Material.FLINT), SlimefunItems.COMPRESSED_CARBON, SlimefunItems.COMPRESSED_CARBON, SlimefunItems.COMPRESSED_CARBON, SlimefunItems.COMPRESSED_CARBON})
|
||||||
.register(plugin);
|
.register(plugin);
|
||||||
|
|
||||||
new SlimefunItem(categories.technicalComponents, SlimefunItems.STEEL_THRUSTER, RecipeType.ENHANCED_CRAFTING_TABLE,
|
new SteelThruster(categories.technicalComponents, SlimefunItems.STEEL_THRUSTER, RecipeType.ENHANCED_CRAFTING_TABLE,
|
||||||
new ItemStack[] {null, new ItemStack(Material.REDSTONE), null, SlimefunItems.ALUMINUM_BRONZE_INGOT, SlimefunItems.ALUMINUM_BRONZE_INGOT, SlimefunItems.ALUMINUM_BRONZE_INGOT, SlimefunItems.STEEL_PLATE, new ItemStack(Material.FIRE_CHARGE), SlimefunItems.STEEL_PLATE})
|
new ItemStack[] {null, new ItemStack(Material.REDSTONE), null, SlimefunItems.ALUMINUM_BRONZE_INGOT, SlimefunItems.ALUMINUM_BRONZE_INGOT, SlimefunItems.ALUMINUM_BRONZE_INGOT, SlimefunItems.STEEL_PLATE, new ItemStack(Material.FIRE_CHARGE), SlimefunItems.STEEL_PLATE})
|
||||||
.register(plugin);
|
.register(plugin);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user