mirror of
https://github.com/Xiao-MoMi/Custom-Crops.git
synced 2025-12-25 18:09:28 +00:00
3.5.1
This commit is contained in:
@@ -47,8 +47,8 @@ public enum DependencyRepository {
|
||||
@Override
|
||||
protected URLConnection openConnection(Dependency dependency) throws IOException {
|
||||
URLConnection connection = super.openConnection(dependency);
|
||||
connection.setConnectTimeout((int) TimeUnit.SECONDS.toMillis(5));
|
||||
connection.setReadTimeout((int) TimeUnit.SECONDS.toMillis(5));
|
||||
connection.setConnectTimeout(5000);
|
||||
connection.setReadTimeout(5000);
|
||||
return connection;
|
||||
}
|
||||
},
|
||||
|
||||
@@ -60,6 +60,8 @@ import net.momirealms.customcrops.mechanic.world.block.MemoryCrop;
|
||||
import net.momirealms.customcrops.util.ClassUtils;
|
||||
import net.momirealms.customcrops.util.ConfigUtils;
|
||||
import net.momirealms.customcrops.util.ItemUtils;
|
||||
import net.momirealms.sparrow.heart.SparrowHeart;
|
||||
import net.momirealms.sparrow.heart.argument.HandSlot;
|
||||
import org.bukkit.*;
|
||||
import org.bukkit.block.BlockFace;
|
||||
import org.bukkit.configuration.ConfigurationSection;
|
||||
@@ -434,10 +436,7 @@ public class ActionManagerImpl implements ActionManager {
|
||||
return state -> {
|
||||
if (Math.random() > chance) return;
|
||||
if (state.getPlayer() == null) return;
|
||||
PacketContainer animationPacket = new PacketContainer(PacketType.Play.Server.ANIMATION);
|
||||
animationPacket.getIntegers().write(0, state.getPlayer().getEntityId());
|
||||
animationPacket.getIntegers().write(1, arg ? 0 : 3);
|
||||
PacketManager.getInstance().send(state.getPlayer(), animationPacket);
|
||||
SparrowHeart.getInstance().swingHand(state.getPlayer(), arg ? HandSlot.MAIN : HandSlot.OFF);
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
@@ -243,6 +243,10 @@ public class BukkitWorldAdaptor extends AbstractWorldAdaptor {
|
||||
@Override
|
||||
public void saveChunkToCachedRegion(CustomCropsChunk customCropsChunk) {
|
||||
CustomCropsRegion customCropsRegion = customCropsChunk.getCustomCropsRegion();
|
||||
if (customCropsRegion == null) {
|
||||
LogUtils.severe(customCropsChunk.getChunkPos().toString() + " unloaded before chunk saving");
|
||||
return;
|
||||
}
|
||||
SerializableChunk serializableChunk = toSerializableChunk((CChunk) customCropsChunk);
|
||||
if (serializableChunk.canPrune()) {
|
||||
customCropsRegion.removeChunk(customCropsChunk.getChunkPos());
|
||||
|
||||
Reference in New Issue
Block a user