Skip to content

Commit

Permalink
chore: 综合性能优化
Browse files Browse the repository at this point in the history
  • Loading branch information
mcchampions committed Dec 21, 2024
1 parent a3ecc84 commit 091f7ed
Show file tree
Hide file tree
Showing 20 changed files with 100 additions and 97 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,20 @@ public class RecordKey extends ScopeKey {
private volatile boolean changed = true;

public RecordKey(DataScope scope) {
this(scope, EnumSet.noneOf(FieldKey.class));
super(scope);
this.fields = EnumSet.noneOf(FieldKey.class);
this.conditions = new LinkedList<>();
}

public RecordKey(DataScope scope, Set<FieldKey> fields) {
this(scope, fields, new LinkedList<>());
super(scope);
this.fields = fields;
this.conditions = new LinkedList<>();
}

public RecordKey(DataScope scope, Set<FieldKey> fields, List<Pair<FieldKey, String>> conditions) {
super(scope);
this.fields = fields.isEmpty() ? fields : new HashSet<>(fields);
this.fields = fields.isEmpty() ? fields : EnumSet.copyOf(fields);
this.conditions = conditions.isEmpty() ? conditions : new LinkedList<>(conditions);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ public void openTransmitterControlPanel(Player p) {
"§8\u21E8 §7Z: §f" + l.getZ(),
"",
"§8\u21E8 §7信号强度: §f" + transmitter.getMultiplier(l.getBlockY()),
"§8\u21E8 §7延迟: §f" + NumberUtils.roundDecimalNumber(1000D / l.getY()) + "ms"));
"§8\u21E8 §7延迟: §f" + NumberUtils.roundDecimalNumber(1000.0D / l.getY()) + "ms"));
menu.addMenuClickHandler(slot, ChestMenuUtils.getEmptyClickHandler());

index++;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public void openTeleporterGUI(Player p, UUID ownerUUID, Block b, int complexity)
+ Slimefun.getLocalization().getMessage(p, "machines.TELEPORTER.gui.title")));
menu.addMenuClickHandler(4, ChestMenuUtils.getEmptyClickHandler());

Location source = new Location(b.getWorld(), b.getX() + 0.5D, b.getY() + 2D, b.getZ() + 0.5D);
Location source = new Location(b.getWorld(), b.getX() + 0.5D, b.getY() + 2.0D, b.getZ() + 0.5D);
int index = 0;

for (Waypoint waypoint : profile.getWaypoints()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class NetworkVisualizer implements Runnable {
*/
NetworkVisualizer(Network network, Color color) {
this.network = network;
this.particleOptions = new DustOptions(color, 3F);
this.particleOptions = new DustOptions(color, 3.0F);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ private int tickAllGenerators(LongConsumer timings) {

Slimefun.runSync(() -> {
loc.getBlock().setType(Material.LAVA);
loc.getWorld().createExplosion(loc, 0F, false);
loc.getWorld().createExplosion(loc, 0.0F, false);
});
} else {
supply = NumberUtils.flowSafeAddition(supply, energy);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ protected void addLanguage(String id, String texture) {
* @return A percentage {@code (0.0 - 100.0)} for the progress of translation of that {@link Language}
*/
public static double calculateProgress(Language lang) {
return 100d;
return 100.0d;
}

private FileConfiguration getConfigurationFromStream(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,87 +23,87 @@
*
*/
public enum SoundEffect {
ANCIENT_ALTAR_ITEM_CHECK_SOUND(Sound.ENTITY_ENDERMAN_TELEPORT, 1F, 2F),
ANCIENT_ALTAR_ITEM_DROP_SOUND(Sound.ENTITY_ZOMBIE_ATTACK_IRON_DOOR, 1F, 1F),
ANCIENT_ALTAR_ITEM_PICK_UP_SOUND(Sound.ENTITY_ITEM_PICKUP, 1F, 1F),
ANCIENT_ALTAR_FINISH_SOUND(Sound.ENTITY_ZOMBIE_VILLAGER_CURE, 1F, 1F),
ANCIENT_ALTAR_START_SOUND(Sound.ENTITY_ILLUSIONER_PREPARE_MIRROR, 1F, 1F),
ANCIENT_ALTAR_ITEM_CHECK_SOUND(Sound.ENTITY_ENDERMAN_TELEPORT, 1.0F, 2.0F),
ANCIENT_ALTAR_ITEM_DROP_SOUND(Sound.ENTITY_ZOMBIE_ATTACK_IRON_DOOR, 1.0F, 1.0F),
ANCIENT_ALTAR_ITEM_PICK_UP_SOUND(Sound.ENTITY_ITEM_PICKUP, 1.0F, 1.0F),
ANCIENT_ALTAR_FINISH_SOUND(Sound.ENTITY_ZOMBIE_VILLAGER_CURE, 1.0F, 1.0F),
ANCIENT_ALTAR_START_SOUND(Sound.ENTITY_ILLUSIONER_PREPARE_MIRROR, 1.0F, 1.0F),
ANCIENT_PEDESTAL_ITEM_PLACE_SOUND(Sound.ENTITY_ITEM_PICKUP, 0.5F, 0.5F),
ARMOR_FORGE_FINISH_SOUND(Sound.BLOCK_ANVIL_USE, 1F, 1F),
ARMOR_FORGE_WORKING_SOUND(Sound.ENTITY_ARROW_HIT_PLAYER, 1F, 1F),
AUTO_CRAFTER_GUI_CLICK_SOUND(Sound.UI_BUTTON_CLICK, 1F, 1F),
AUTO_CRAFTER_UPDATE_RECIPE(Sound.UI_BUTTON_CLICK, 1F, 1F),
AUTOMATED_PANNING_MACHINE_FAIL_SOUND(Sound.ENTITY_ARMOR_STAND_BREAK, 1F, 1F),
AUTOMATED_PANNING_MACHINE_SUCCESS_SOUND(Sound.ENTITY_ARROW_HIT_PLAYER, 1F, 1F),
BEE_BOOTS_FALL_SOUND(Sound.BLOCK_HONEY_BLOCK_FALL, 1F, 1F),
BACKPACK_CLOSE_SOUND(Sound.ENTITY_HORSE_ARMOR, 1F, 1F),
BACKPACK_OPEN_SOUND(Sound.ENTITY_HORSE_ARMOR, 1F, 1F),
COMPOSTER_COMPOST_SOUND(Sound.ENTITY_ARROW_HIT_PLAYER, 1F, 1F),
COMPRESSOR_CRAFT_SOUND(Sound.ENTITY_ARROW_HIT_PLAYER, 1F, 1F),
COMPRESSOR_CRAFT_CONTRACT_SOUND(Sound.BLOCK_PISTON_CONTRACT, 1F, 1F),
COMPRESSOR_CRAFT_EXTEND_SOUND(Sound.BLOCK_PISTON_EXTEND, 1F, 1F),
COOLER_CONSUME_SOUND(Sound.ENTITY_GENERIC_DRINK, 1F, 1F),
CRUCIBLE_ADD_WATER_SOUND(Sound.ENTITY_PLAYER_SPLASH, 1F, 1F),
CRUCIBLE_ADD_LAVA_SOUND(Sound.BLOCK_LAVA_POP, 1F, 1F),
CRUCIBLE_BLOCK_BREAK_SOUND(Sound.BLOCK_METAL_BREAK, 1F, 1F),
CRUCIBLE_GENERATE_LIQUID_SOUND(Sound.BLOCK_LAVA_EXTINGUISH, 1F, 1F),
CRUCIBLE_INTERACT_SOUND(Sound.ENTITY_ARROW_HIT_PLAYER, 1F, 1F),
CRUCIBLE_PLACE_LAVA_SOUND(Sound.BLOCK_LAVA_POP, 1F, 1F),
CRUCIBLE_PLACE_WATER_SOUND(Sound.ENTITY_PLAYER_SPLASH, 1F, 1F),
DEBUG_FISH_CLICK_SOUND(Sound.BLOCK_BAMBOO_PLACE, 1F, 1F),
DIET_COOKIE_CONSUME_SOUND(Sound.ENTITY_GENERIC_EAT, 1F, 1F),
ENCHANTMENT_RUNE_ADD_ENCHANT_SOUND(Sound.ENTITY_ZOMBIE_VILLAGER_CURE, 1F, 1F),
ENDER_BACKPACK_OPEN_SOUND(Sound.ENTITY_ENDERMAN_TELEPORT, 1F, 1F),
ENHANCED_CRAFTING_TABLE_CRAFT_SOUND(Sound.BLOCK_WOODEN_BUTTON_CLICK_ON, 1F, 1F),
ELYTRA_CAP_IMPACT_SOUND(Sound.BLOCK_STONE_HIT, 1F, 1F),
EXPLOSIVE_BOW_HIT_SOUND(Sound.ENTITY_GENERIC_EXPLODE, 1F, 1F),
EXPLOSIVE_TOOL_EXPLODE_SOUND(Sound.ENTITY_GENERIC_EXPLODE, 0.2F, 1F),
ARMOR_FORGE_FINISH_SOUND(Sound.BLOCK_ANVIL_USE, 1.0F, 1.0F),
ARMOR_FORGE_WORKING_SOUND(Sound.ENTITY_ARROW_HIT_PLAYER, 1.0F, 1.0F),
AUTO_CRAFTER_GUI_CLICK_SOUND(Sound.UI_BUTTON_CLICK, 1.0F, 1.0F),
AUTO_CRAFTER_UPDATE_RECIPE(Sound.UI_BUTTON_CLICK, 1.0F, 1.0F),
AUTOMATED_PANNING_MACHINE_FAIL_SOUND(Sound.ENTITY_ARMOR_STAND_BREAK, 1.0F, 1.0F),
AUTOMATED_PANNING_MACHINE_SUCCESS_SOUND(Sound.ENTITY_ARROW_HIT_PLAYER, 1.0F, 1.0F),
BEE_BOOTS_FALL_SOUND(Sound.BLOCK_HONEY_BLOCK_FALL, 1.0F, 1.0F),
BACKPACK_CLOSE_SOUND(Sound.ENTITY_HORSE_ARMOR, 1.0F, 1.0F),
BACKPACK_OPEN_SOUND(Sound.ENTITY_HORSE_ARMOR, 1.0F, 1.0F),
COMPOSTER_COMPOST_SOUND(Sound.ENTITY_ARROW_HIT_PLAYER, 1.0F, 1.0F),
COMPRESSOR_CRAFT_SOUND(Sound.ENTITY_ARROW_HIT_PLAYER, 1.0F, 1.0F),
COMPRESSOR_CRAFT_CONTRACT_SOUND(Sound.BLOCK_PISTON_CONTRACT, 1.0F, 1.0F),
COMPRESSOR_CRAFT_EXTEND_SOUND(Sound.BLOCK_PISTON_EXTEND, 1.0F, 1.0F),
COOLER_CONSUME_SOUND(Sound.ENTITY_GENERIC_DRINK, 1.0F, 1.0F),
CRUCIBLE_ADD_WATER_SOUND(Sound.ENTITY_PLAYER_SPLASH, 1.0F, 1.0F),
CRUCIBLE_ADD_LAVA_SOUND(Sound.BLOCK_LAVA_POP, 1.0F, 1.0F),
CRUCIBLE_BLOCK_BREAK_SOUND(Sound.BLOCK_METAL_BREAK, 1.0F, 1.0F),
CRUCIBLE_GENERATE_LIQUID_SOUND(Sound.BLOCK_LAVA_EXTINGUISH, 1.0F, 1.0F),
CRUCIBLE_INTERACT_SOUND(Sound.ENTITY_ARROW_HIT_PLAYER, 1.0F, 1.0F),
CRUCIBLE_PLACE_LAVA_SOUND(Sound.BLOCK_LAVA_POP, 1.0F, 1.0F),
CRUCIBLE_PLACE_WATER_SOUND(Sound.ENTITY_PLAYER_SPLASH, 1.0F, 1.0F),
DEBUG_FISH_CLICK_SOUND(Sound.BLOCK_BAMBOO_PLACE, 1.0F, 1.0F),
DIET_COOKIE_CONSUME_SOUND(Sound.ENTITY_GENERIC_EAT, 1.0F, 1.0F),
ENCHANTMENT_RUNE_ADD_ENCHANT_SOUND(Sound.ENTITY_ZOMBIE_VILLAGER_CURE, 1.0F, 1.0F),
ENDER_BACKPACK_OPEN_SOUND(Sound.ENTITY_ENDERMAN_TELEPORT, 1.0F, 1.0F),
ENHANCED_CRAFTING_TABLE_CRAFT_SOUND(Sound.BLOCK_WOODEN_BUTTON_CLICK_ON, 1.0F, 1.0F),
ELYTRA_CAP_IMPACT_SOUND(Sound.BLOCK_STONE_HIT, 1.0F, 1.0F),
EXPLOSIVE_BOW_HIT_SOUND(Sound.ENTITY_GENERIC_EXPLODE, 1.0F, 1.0F),
EXPLOSIVE_TOOL_EXPLODE_SOUND(Sound.ENTITY_GENERIC_EXPLODE, 0.2F, 1.0F),
FISHERMAN_ANDROID_FISHING_SOUND(Sound.ENTITY_PLAYER_SPLASH, 0.3F, 0.7F),
FLASK_OF_KNOWLEDGE_FILLUP_SOUND(Sound.ENTITY_EXPERIENCE_ORB_PICKUP, 1F, 0.5F),
GUIDE_BUTTON_CLICK_SOUND(Sound.ITEM_BOOK_PAGE_TURN, 1F, 1F),
FLASK_OF_KNOWLEDGE_FILLUP_SOUND(Sound.ENTITY_EXPERIENCE_ORB_PICKUP, 1.0F, 0.5F),
GUIDE_BUTTON_CLICK_SOUND(Sound.ITEM_BOOK_PAGE_TURN, 1.0F, 1.0F),
GUIDE_CONTRIBUTORS_OPEN_SOUND(Sound.BLOCK_NOTE_BLOCK_HARP, 0.7F, 0.7F),
GUIDE_LANGUAGE_OPEN_SOUND(Sound.BLOCK_NOTE_BLOCK_HARP, 0.7F, 0.7F),
GUIDE_OPEN_SETTING_SOUND(Sound.BLOCK_NOTE_BLOCK_HARP, 0.7F, 0.7F),
GRIND_STONE_INTERACT_SOUND(Sound.BLOCK_WOODEN_BUTTON_CLICK_ON, 1F, 1F),
IGNITION_CHAMBER_USE_FLINT_AND_STEEL_SOUND(Sound.ENTITY_ITEM_BREAK, 1F, 1F),
INFUSED_HOPPER_TELEPORT_SOUND(Sound.ENTITY_ENDERMAN_TELEPORT, 0.5F, 2F),
GRIND_STONE_INTERACT_SOUND(Sound.BLOCK_WOODEN_BUTTON_CLICK_ON, 1.0F, 1.0F),
IGNITION_CHAMBER_USE_FLINT_AND_STEEL_SOUND(Sound.ENTITY_ITEM_BREAK, 1.0F, 1.0F),
INFUSED_HOPPER_TELEPORT_SOUND(Sound.ENTITY_ENDERMAN_TELEPORT, 0.5F, 2.0F),
INFUSED_MAGNET_TELEPORT_SOUND(Sound.ENTITY_ENDERMAN_TELEPORT, 0.25F, 0.9F),
IRON_GOLEM_ASSEMBLER_ASSEMBLE_SOUND(Sound.ENTITY_IRON_GOLEM_REPAIR, 0.5F, 1F),
JETBOOTS_THRUST_SOUND(Sound.ENTITY_TNT_PRIMED, 0.25F, 1F),
JETPACK_THRUST_SOUND(Sound.ENTITY_GENERIC_EXPLODE, 0.25F, 1F),
JUICER_USE_SOUND(Sound.ENTITY_PLAYER_SPLASH, 1F, 1F),
LIMITED_USE_ITEM_BREAK_SOUND(Sound.ENTITY_ITEM_BREAK, 1F, 1F),
MAGICAL_EYE_OF_ENDER_USE_SOUND(Sound.ENTITY_ENDERMAN_TELEPORT, 1F, 1F),
MAGIC_SUGAR_CONSUME_SOUND(Sound.ENTITY_GENERIC_EAT, 1F, 1F),
MAGIC_WORKBENCH_FINISH_SOUND(Sound.ENTITY_ARROW_HIT_PLAYER, 1F, 1F),
MAGIC_WORKBENCH_START_ANIMATION_SOUND(Sound.BLOCK_WOODEN_BUTTON_CLICK_ON, 1F, 1F),
IRON_GOLEM_ASSEMBLER_ASSEMBLE_SOUND(Sound.ENTITY_IRON_GOLEM_REPAIR, 0.5F, 1.0F),
JETBOOTS_THRUST_SOUND(Sound.ENTITY_TNT_PRIMED, 0.25F, 1.0F),
JETPACK_THRUST_SOUND(Sound.ENTITY_GENERIC_EXPLODE, 0.25F, 1.0F),
JUICER_USE_SOUND(Sound.ENTITY_PLAYER_SPLASH, 1.0F, 1.0F),
LIMITED_USE_ITEM_BREAK_SOUND(Sound.ENTITY_ITEM_BREAK, 1.0F, 1.0F),
MAGICAL_EYE_OF_ENDER_USE_SOUND(Sound.ENTITY_ENDERMAN_TELEPORT, 1.0F, 1.0F),
MAGIC_SUGAR_CONSUME_SOUND(Sound.ENTITY_GENERIC_EAT, 1.0F, 1.0F),
MAGIC_WORKBENCH_FINISH_SOUND(Sound.ENTITY_ARROW_HIT_PLAYER, 1.0F, 1.0F),
MAGIC_WORKBENCH_START_ANIMATION_SOUND(Sound.BLOCK_WOODEN_BUTTON_CLICK_ON, 1.0F, 1.0F),
MINER_ANDROID_BLOCK_GENERATION_SOUND(Sound.BLOCK_FIRE_EXTINGUISH, 0.075F, 0.8F),
MINING_TASK_SOUND(Sound.ENTITY_ARROW_HIT_PLAYER, 0.2F, 1F),
ORE_WASHER_WASH_SOUND(Sound.ENTITY_PLAYER_SPLASH, 1F, 1F),
PLAYER_RESEARCHING_SOUND(Sound.ENTITY_BAT_TAKEOFF, 0.7F, 1F),
PORTABLE_DUSTBIN_OPEN_SOUND(Sound.BLOCK_ANVIL_LAND, 1F, 1F),
PORTABLE_CRAFTER_OPEN_SOUND(Sound.BLOCK_WOODEN_BUTTON_CLICK_ON, 1F, 1F),
PRESSURE_CHAMBER_FINISH_SOUND(Sound.ENTITY_ARROW_HIT_PLAYER, 1F, 1F),
PRESSURE_CHAMBER_WORKING_SOUND(Sound.ENTITY_TNT_PRIMED, 1F, 1F),
MINING_TASK_SOUND(Sound.ENTITY_ARROW_HIT_PLAYER, 0.2F, 1.0F),
ORE_WASHER_WASH_SOUND(Sound.ENTITY_PLAYER_SPLASH, 1.0F, 1.0F),
PLAYER_RESEARCHING_SOUND(Sound.ENTITY_BAT_TAKEOFF, 0.7F, 1.0F),
PORTABLE_DUSTBIN_OPEN_SOUND(Sound.BLOCK_ANVIL_LAND, 1.0F, 1.0F),
PORTABLE_CRAFTER_OPEN_SOUND(Sound.BLOCK_WOODEN_BUTTON_CLICK_ON, 1.0F, 1.0F),
PRESSURE_CHAMBER_FINISH_SOUND(Sound.ENTITY_ARROW_HIT_PLAYER, 1.0F, 1.0F),
PRESSURE_CHAMBER_WORKING_SOUND(Sound.ENTITY_TNT_PRIMED, 1.0F, 1.0F),
PROGRAMMABLE_ANDROID_SCRIPT_DOWNLOAD_SOUND(Sound.BLOCK_NOTE_BLOCK_HAT, 0.7F, 0.7F),
SLIME_BOOTS_FALL_SOUND(Sound.BLOCK_SLIME_BLOCK_FALL, 1F, 1F),
TELEPORTATION_MANAGER_OPEN_GUI(Sound.UI_BUTTON_CLICK, 1F, 1F),
GPS_NETWORK_ADD_WAYPOINT(Sound.BLOCK_NOTE_BLOCK_PLING, 1F, 1F),
GPS_NETWORK_CREATE_WAYPOINT(Sound.BLOCK_NOTE_BLOCK_PLING, 0.5F, 1F),
GPS_NETWORK_OPEN_PANEL_SOUND(Sound.UI_BUTTON_CLICK, 1F, 1F),
SMELTERY_CRAFT_SOUND(Sound.BLOCK_LAVA_POP, 1F, 1F),
SOULBOUND_RUNE_RITUAL_SOUND(Sound.ENTITY_GENERIC_EXPLODE, 0.3F, 1F),
SPLINT_CONSUME_SOUND(Sound.ENTITY_SKELETON_HURT, 1F, 1F),
STOMPER_BOOTS_STOMP_SOUND(Sound.ENTITY_ZOMBIE_BREAK_WOODEN_DOOR, 1F, 2F),
SLIME_BOOTS_FALL_SOUND(Sound.BLOCK_SLIME_BLOCK_FALL, 1.0F, 1.0F),
TELEPORTATION_MANAGER_OPEN_GUI(Sound.UI_BUTTON_CLICK, 1.0F, 1.0F),
GPS_NETWORK_ADD_WAYPOINT(Sound.BLOCK_NOTE_BLOCK_PLING, 1.0F, 1.0F),
GPS_NETWORK_CREATE_WAYPOINT(Sound.BLOCK_NOTE_BLOCK_PLING, 0.5F, 1.0F),
GPS_NETWORK_OPEN_PANEL_SOUND(Sound.UI_BUTTON_CLICK, 1.0F, 1.0F),
SMELTERY_CRAFT_SOUND(Sound.BLOCK_LAVA_POP, 1.0F, 1.0F),
SOULBOUND_RUNE_RITUAL_SOUND(Sound.ENTITY_GENERIC_EXPLODE, 0.3F, 1.0F),
SPLINT_CONSUME_SOUND(Sound.ENTITY_SKELETON_HURT, 1.0F, 1.0F),
STOMPER_BOOTS_STOMP_SOUND(Sound.ENTITY_ZOMBIE_BREAK_WOODEN_DOOR, 1.0F, 2.0F),
TAPE_MEASURE_MEASURE_SOUND(Sound.ITEM_BOOK_PUT, 1, 0.7F),
TOME_OF_KNOWLEDGE_USE_SOUND(Sound.ENTITY_PLAYER_LEVELUP, 1F, 1F),
TELEPORT_UPDATE_SOUND(Sound.BLOCK_BEACON_AMBIENT, 1F, 0.6F),
TELEPORT_SOUND(Sound.BLOCK_BEACON_ACTIVATE, 1F, 1F),
TOME_OF_KNOWLEDGE_USE_SOUND(Sound.ENTITY_PLAYER_LEVELUP, 1.0F, 1.0F),
TELEPORT_UPDATE_SOUND(Sound.BLOCK_BEACON_AMBIENT, 1.0F, 0.6F),
TELEPORT_SOUND(Sound.BLOCK_BEACON_ACTIVATE, 1.0F, 1.0F),
VAMPIRE_BLADE_HEALING_SOUND(Sound.ENTITY_ARROW_HIT_PLAYER, 0.7F, 0.7F),
VANILLA_AUTO_CRAFTER_UPDATE_RECIPE_SOUND(Sound.UI_BUTTON_CLICK, 1F, 1F),
VILLAGER_RUNE_TRANSFORM_SOUND(Sound.ENTITY_VILLAGER_CELEBRATE, 1F, 1.4F),
VITAMINS_CONSUME_SOUND(Sound.ENTITY_GENERIC_EAT, 1F, 1F),
WIND_STAFF_USE_SOUND(Sound.ENTITY_TNT_PRIMED, 1F, 1F);
VANILLA_AUTO_CRAFTER_UPDATE_RECIPE_SOUND(Sound.UI_BUTTON_CLICK, 1.0F, 1.0F),
VILLAGER_RUNE_TRANSFORM_SOUND(Sound.ENTITY_VILLAGER_CELEBRATE, 1.0F, 1.4F),
VITAMINS_CONSUME_SOUND(Sound.ENTITY_GENERIC_EAT, 1.0F, 1.0F),
WIND_STAFF_USE_SOUND(Sound.ENTITY_TNT_PRIMED, 1.0F, 1.0F);

private final String defaultSound;
@Getter
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public AndroidType getAndroidType() {

@Override
protected void attack(Block b, BlockFace face, Predicate<LivingEntity> predicate) {
double damage = getTier() >= 3 ? 20D : 4D * getTier();
double damage = getTier() >= 3 ? 20.0D : 4.0D * getTier();
double radius = 4.0 + getTier();

for (Entity n : b.getWorld()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
import org.bukkit.Color;
import org.bukkit.DyeColor;
import org.bukkit.inventory.ItemStack;
import org.bukkit.potion.PotionEffect;

/**
* Represents a {@link SlimefunArmorPiece} with rainbow properties (leather armor changing color).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ private boolean charge(BlockMenu inv, int slot, ItemStack item, SlimefunBlockDat
SlimefunItem sfItem = SlimefunItem.getByItem(item);

if (sfItem instanceof Rechargeable rechargeable) {
float charge = getEnergyConsumption() / 2F / item.getAmount();
float charge = getEnergyConsumption() / 2.0F / item.getAmount();

if (rechargeable.addItemCharge(item, charge)) {
removeCharge(data.getLocation(), getEnergyConsumption());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ public ItemUseHandler getItemHandler() {
if (n instanceof LivingEntity
&& !(n instanceof ArmorStand)
&& !n.getUniqueId().equals(e.getPlayer().getUniqueId())) {
float yaw = n.getLocation().getYaw() + 180F;
float yaw = n.getLocation().getYaw() + 180.0F;

if (yaw > 360F) {
yaw = yaw - 360F;
if (yaw > 360.0F) {
yaw = yaw - 360.0F;
}

n.teleport(new Location(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public ItemUseHandler getItemHandler() {
p.setVelocity(p.getEyeLocation().getDirection().multiply(multiplier.getValue()));
SoundEffect.WIND_STAFF_USE_SOUND.playFor(p);
p.getWorld().playEffect(p.getLocation(), Effect.SMOKE, 1);
p.setFallDistance(0F);
p.setFallDistance(0.0F);
} else {
Slimefun.getLocalization().sendMessage(p, "messages.hungry", true);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ private void nextColumn() {
Player p = Bukkit.getPlayer(owner);

if (p != null) {
p.playSound(p.getLocation(), Sound.ENTITY_ARROW_HIT_PLAYER, 0.4F, 1F);
p.playSound(p.getLocation(), Sound.ENTITY_ARROW_HIT_PLAYER, 0.4F, 1.0F);
Slimefun.getLocalization()
.sendMessage(
p,
Expand Down Expand Up @@ -400,6 +400,6 @@ private static void setExtended(Block block, Piston piston, boolean extended) {
block.getLocation(),
extended ? Sound.BLOCK_PISTON_EXTEND : Sound.BLOCK_PISTON_CONTRACT,
0.1F,
1F);
1.0F);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ private boolean consumeJuice(Player p, ItemStack coolerItem, PlayerBackpack back
p.addPotionEffect(effect);
}

p.setSaturation(6F);
p.setSaturation(6.0F);
SoundEffect.COOLER_CONSUME_SOUND.playFor(p);
inv.setItem(slot, null);
Slimefun.getDatabaseManager().getProfileDataController().saveBackpackInventory(backpack, slot);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public void onDamage(EntityDamageByEntityEvent e) {
}
}

e.setDamage(0D);
e.setDamage(0.0D);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,8 @@ private boolean checkLockedItems() {
}

private void idle() {
dropLocation.getWorld().spawnParticle(VersionedParticle.WITCH, dropLocation, 16, 1.2F, 0F, 1.2F);
dropLocation.getWorld().spawnParticle(VersionedParticle.FIREWORK, dropLocation, 8, 0.2F, 0F, 0.2F);
dropLocation.getWorld().spawnParticle(VersionedParticle.WITCH, dropLocation, 16, 1.2F, 0.0F, 1.2F);
dropLocation.getWorld().spawnParticle(VersionedParticle.FIREWORK, dropLocation, 8, 0.2F, 0.0F, 0.2F);

for (Location loc : particleLocations) {
dropLocation.getWorld().spawnParticle(VersionedParticle.ENCHANT, loc, 16, 0.3F, 0.2F, 0.3F);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ protected void executeTask() {
if (boots.removeItemCharge(p.getInventory().getBoots(), COST)) {
SoundEffect.JETBOOTS_THRUST_SOUND.playAt(p.getLocation(), SoundCategory.PLAYERS);
p.getWorld().playEffect(p.getLocation(), Effect.SMOKE, 1, 1);
p.setFallDistance(0F);
p.setFallDistance(0.0F);
double gravity = 0.04;
double offset = ThreadLocalRandom.current().nextBoolean() ? accuracy : -accuracy;
Vector vector = new Vector(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ protected void executeTask() {
if (jetpack.removeItemCharge(p.getInventory().getChestplate(), COST)) {
SoundEffect.JETPACK_THRUST_SOUND.playAt(p.getLocation(), SoundCategory.PLAYERS);
p.getWorld().playEffect(p.getLocation(), Effect.SMOKE, 1, 1);
p.setFallDistance(0F);
p.setFallDistance(0.0F);
Vector vector = new Vector(0, 1, 0);
vector.multiply(jetpack.getThrust());
vector.add(p.getEyeLocation().getDirection().multiply(0.2F));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ protected void executeTask() {
Vector vector = new Vector(0, 1, 0);
vector.multiply(-0.1);
p.setVelocity(vector);
p.setFallDistance(0F);
p.setFallDistance(0.0F);

if (!p.isSneaking()) {
cancel();
Expand Down
Loading

0 comments on commit 091f7ed

Please sign in to comment.