Skip to content

Commit b3222a4

Browse files
committed
cleaned up some code style
1 parent 08352b6 commit b3222a4

101 files changed

Lines changed: 756 additions & 679 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

commons/src/main/java/net/swofty/commons/item/attribute/attributes/ItemAttributeHotPotatoBookData.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public HotPotatoBookData loadFromString(String string) {
3535
JSONObject obj = new JSONObject(string);
3636

3737
PotatoType potatoType = null;
38-
if (obj.has("potatoType")){
38+
if (obj.has("potatoType")) {
3939
potatoType = obj.getEnum(PotatoType.class, "potatoType");
4040
}
4141

@@ -87,22 +87,22 @@ public static class HotPotatoBookData {
8787
private HashMap<ItemType, Integer> appliedItems = new HashMap<>();
8888

8989
public void addAmount(ItemType itemType, int amount) {
90-
if (!appliedItems.containsKey(itemType)){
90+
if (!appliedItems.containsKey(itemType)) {
9191
appliedItems.put(itemType, amount);
9292
}else{
9393
appliedItems.put(itemType, appliedItems.get(itemType) + amount);
9494
}
9595
}
9696

97-
public int getAmount(ItemType type){
97+
public int getAmount(ItemType type) {
9898
return appliedItems.getOrDefault(type, 0);
9999
}
100100

101-
public boolean hasAppliedItem(ItemType itemType){
101+
public boolean hasAppliedItem(ItemType itemType) {
102102
return appliedItems.containsKey(itemType) && appliedItems.get(itemType) > 0;
103103
}
104104

105-
public boolean hasAppliedItem(){
105+
public boolean hasAppliedItem() {
106106
return appliedItems.values().stream().mapToInt(Integer::intValue).sum() > 0;
107107
}
108108
}

spark/src/main/java/net/swofty/spark/MinestomCommandSender.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public void sendMessage(Component message) {
4343

4444
@Override
4545
public boolean hasPermission(String permission) {
46-
if (delegate instanceof Player player){
46+
if (delegate instanceof Player player) {
4747
return HypixelGenericLoader.getFromUUID(player.getUuid()).getDataHandler()
4848
.get(HypixelDataHandler.Data.RANK, DatapointRank.class)
4949
.getValue() == Rank.ADMIN;

type.generic/src/main/java/net/swofty/type/generic/user/HypixelPlayer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ public AntiCheatHandler getAntiCheatHandler() {
7979
return new AntiCheatHandler(this);
8080
}
8181

82-
public PlayerSkin getPlayerSkin(){
82+
public PlayerSkin getPlayerSkin() {
8383
String texture = getDataHandler().get(HypixelDataHandler.Data.SKIN_TEXTURE , DatapointString.class).getValue();
8484
String signature = getDataHandler().get(HypixelDataHandler.Data.SKIN_SIGNATURE , DatapointString.class).getValue();
8585
return new PlayerSkin(texture , signature);

type.generic/src/main/java/net/swofty/type/generic/utility/BlockUtility.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
public class BlockUtility {
88

9-
public static Block applyTexture(Block block , String texture){
9+
public static Block applyTexture(Block block , String texture) {
1010
JSONObject json = new JSONObject();
1111
json.put("isPublic", true);
1212
json.put("signatureRequired", false);

type.hub/src/main/java/net/swofty/type/hub/villagers/VillagerBlacksmith.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public void onClick(PlayerClickVillagerNPCEvent e) {
5050
});
5151
return;
5252
}
53-
if (!data.hasCompleted(MissionMineCoal.class)) {
53+
if (!data.hasCompleted(MissionMineCoal.class)) {
5454
player.sendMessage("§e[NPC] Blacksmith§f: Retrieve 10 coal from the Coal Mines!");
5555
return;
5656
}

type.skyblockgeneric/src/main/java/net/swofty/type/skyblockgeneric/chest/ChestAnimationType.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ public enum ChestAnimationType {
1010
OPEN,
1111
CLOSE;
1212

13-
public void play(Instance instance , Point[] positions){
13+
public void play(Instance instance , Point[] positions) {
1414
Arrays.stream(positions).forEach((position) -> {
1515
BlockActionPacket actionPacket = new BlockActionPacket(
1616
position,

type.skyblockgeneric/src/main/java/net/swofty/type/skyblockgeneric/chest/ChestType.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ public enum ChestType {
99
SINGLE,
1010
DOUBLE;
1111

12-
public static ChestType from(Instance instance , Point position){
12+
public static ChestType from(Instance instance , Point position) {
1313
for (BlockFace face : BlockFace.values()) {
1414
Block adjacent = instance.getBlock(position.add(face.toDirection().normalX(), face.toDirection().normalY(), face.toDirection().normalZ()));
1515
if (adjacent.name().equals("minecraft:chest")) {

type.skyblockgeneric/src/main/java/net/swofty/type/skyblockgeneric/commands/MithrilInfuseCommand.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public void registerUsage(MinestomCommand command) {
2121
command.addSyntax((sender, context) -> {
2222
if (!permissionCheck(sender)) return;
2323
SkyBlockPlayer player = ((SkyBlockPlayer) sender);
24-
if(!(new SkyBlockItem(player.getItemInMainHand()).hasComponent(MinionComponent.class))){
24+
if (!(new SkyBlockItem(player.getItemInMainHand()).hasComponent(MinionComponent.class))) {
2525
player.sendMessage("§cMithril Infusions can only be applied to minions.");
2626
return;
2727
}

type.skyblockgeneric/src/main/java/net/swofty/type/skyblockgeneric/event/actions/player/blocks/ActionBlockPlaceable.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
public class ActionBlockPlaceable implements HypixelEventClass {
1515

1616
@HypixelEvent(node = EventNodes.PLAYER , requireDataLoaded = true)
17-
public void onPlace(PlayerBlockPlaceEvent event){
17+
public void onPlace(PlayerBlockPlaceEvent event) {
1818
ItemStack itemStack = event.getPlayer().getItemInMainHand();
1919
SkyBlockItem item = new SkyBlockItem(itemStack);
2020
SkyBlockPlayer player = (SkyBlockPlayer) event.getPlayer();
@@ -25,7 +25,7 @@ public void onPlace(PlayerBlockPlaceEvent event){
2525
PlaceableComponent placeable = item.getComponent(PlaceableComponent.class);
2626
if (placeable.getBlockType() == null) return;
2727
SkyBlockBlock skyBlockBlock = new SkyBlockBlock(placeable.getBlockType());
28-
if (skyBlockBlock.getGenericInstance() instanceof BlockPlaceable blockPlaceable){
28+
if (skyBlockBlock.getGenericInstance() instanceof BlockPlaceable blockPlaceable) {
2929
blockPlaceable.onPlace(event, skyBlockBlock);
3030
}
3131
}

type.skyblockgeneric/src/main/java/net/swofty/type/skyblockgeneric/event/actions/player/gui/ActionPlayerInventoryClick.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ public void run(InventoryPreClickEvent event) {
7171
return;
7272
}
7373

74-
if (event.getInventory() instanceof PlayerInventory){
74+
if (event.getInventory() instanceof PlayerInventory) {
7575
gui.onBottomClick(event);
7676
} else {
7777
int slot = event.getSlot();

0 commit comments

Comments
 (0)