mirror of
https://github.com/Grasscutters/Grasscutter.git
synced 2026-06-07 00:53:35 +08:00
Fix whitespace [skip actions]
This commit is contained in:
committed by
Melledy
Unverified
parent
510d564bcb
commit
ae2d1fe438
@@ -15,25 +15,25 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class FurnitureManager extends BasePlayerManager {
|
||||
|
||||
|
||||
public FurnitureManager(Player player) {
|
||||
super(player);
|
||||
}
|
||||
|
||||
public void onLogin(){
|
||||
public void onLogin() {
|
||||
notifyUnlockFurniture();
|
||||
notifyUnlockFurnitureSuite();
|
||||
}
|
||||
|
||||
public void notifyUnlockFurniture(){
|
||||
public void notifyUnlockFurniture() {
|
||||
player.getSession().send(new PacketUnlockedFurnitureFormulaDataNotify(player.getUnlockedFurniture()));
|
||||
}
|
||||
|
||||
public void notifyUnlockFurnitureSuite(){
|
||||
public void notifyUnlockFurnitureSuite() {
|
||||
player.getSession().send(new PacketUnlockedFurnitureSuiteDataNotify(player.getUnlockedFurnitureSuite()));
|
||||
}
|
||||
|
||||
public synchronized boolean unlockFurnitureOrSuite(GameItem useItem){
|
||||
public synchronized boolean unlockFurnitureOrSuite(GameItem useItem) {
|
||||
// Check
|
||||
if (!List.of("ITEM_USE_UNLOCK_FURNITURE_FORMULA", "ITEM_USE_UNLOCK_FURNITURE_SUITE")
|
||||
.contains(useItem.getItemData().getItemUse().get(0).getUseOp())) {
|
||||
@@ -45,10 +45,10 @@ public class FurnitureManager extends BasePlayerManager {
|
||||
// Remove first
|
||||
player.getInventory().removeItem(useItem, 1);
|
||||
|
||||
if("ITEM_USE_UNLOCK_FURNITURE_FORMULA".equals(useItem.getItemData().getItemUse().get(0).getUseOp())){
|
||||
if ("ITEM_USE_UNLOCK_FURNITURE_FORMULA".equals(useItem.getItemData().getItemUse().get(0).getUseOp())) {
|
||||
player.getUnlockedFurniture().add(furnitureIdOrSuiteId);
|
||||
notifyUnlockFurniture();
|
||||
}else{
|
||||
}else {
|
||||
player.getUnlockedFurnitureSuite().add(furnitureIdOrSuiteId);
|
||||
notifyUnlockFurnitureSuite();
|
||||
}
|
||||
@@ -57,19 +57,19 @@ public class FurnitureManager extends BasePlayerManager {
|
||||
|
||||
public void startMake(int makeId, int avatarId) {
|
||||
var makeData = GameData.getFurnitureMakeConfigDataMap().get(makeId);
|
||||
if(makeData == null){
|
||||
if (makeData == null) {
|
||||
player.getSession().send(new PacketFurnitureMakeStartRsp(Retcode.RET_FURNITURE_MAKE_CONFIG_ERROR_VALUE, null));
|
||||
return;
|
||||
}
|
||||
|
||||
// check slot count
|
||||
if (player.getHome().getLevelData().getFurnitureMakeSlotCount() <= player.getHome().getFurnitureMakeSlotItemList().size()){
|
||||
if (player.getHome().getLevelData().getFurnitureMakeSlotCount() <= player.getHome().getFurnitureMakeSlotItemList().size()) {
|
||||
player.getSession().send(new PacketFurnitureMakeStartRsp(Retcode.RET_FURNITURE_MAKE_SLOT_FULL_VALUE, null));
|
||||
return;
|
||||
}
|
||||
|
||||
// pay items first
|
||||
if(!player.getInventory().payItems(makeData.getMaterialItems().toArray(new ItemParamData[0]))){
|
||||
if (!player.getInventory().payItems(makeData.getMaterialItems().toArray(new ItemParamData[0]))) {
|
||||
player.getSession().send(new PacketFurnitureMakeStartRsp(Retcode.RET_HOME_FURNITURE_COUNT_NOT_ENOUGH_VALUE, null));
|
||||
return;
|
||||
}
|
||||
@@ -93,7 +93,7 @@ public class FurnitureManager extends BasePlayerManager {
|
||||
}
|
||||
|
||||
public void queryStatus() {
|
||||
if (player.getHome().getFurnitureMakeSlotItemList() == null){
|
||||
if (player.getHome().getFurnitureMakeSlotItemList() == null) {
|
||||
player.getHome().setFurnitureMakeSlotItemList(new ArrayList<>());
|
||||
}
|
||||
|
||||
@@ -103,7 +103,7 @@ public class FurnitureManager extends BasePlayerManager {
|
||||
|
||||
public void take(int index, int makeId, boolean isFastFinish) {
|
||||
var makeData = GameData.getFurnitureMakeConfigDataMap().get(makeId);
|
||||
if(makeData == null){
|
||||
if (makeData == null) {
|
||||
player.getSession().send(new PacketTakeFurnitureMakeRsp(Retcode.RET_FURNITURE_MAKE_CONFIG_ERROR_VALUE, makeId, null, null));
|
||||
return;
|
||||
}
|
||||
@@ -112,19 +112,19 @@ public class FurnitureManager extends BasePlayerManager {
|
||||
.filter(x -> x.getIndex() == index && x.getMakeId() == makeId)
|
||||
.findFirst();
|
||||
|
||||
if(slotItem.isEmpty()){
|
||||
if (slotItem.isEmpty()) {
|
||||
player.getSession().send(new PacketTakeFurnitureMakeRsp(Retcode.RET_FURNITURE_MAKE_NO_MAKE_DATA_VALUE, makeId, null, null));
|
||||
return;
|
||||
}
|
||||
|
||||
// pay the speedup item
|
||||
if(isFastFinish && !player.getInventory().payItem(107013,1)){
|
||||
if (isFastFinish && !player.getInventory().payItem(107013,1)) {
|
||||
player.getSession().send(new PacketTakeFurnitureMakeRsp(Retcode.RET_FURNITURE_MAKE_UNFINISH_VALUE, makeId, null, null));
|
||||
return;
|
||||
}
|
||||
|
||||
// check if player can take
|
||||
// if(slotItem.get().getBeginTime() + slotItem.get().getDurTime() >= Utils.getCurrentSeconds() && !isFastFinish){
|
||||
// if (slotItem.get().getBeginTime() + slotItem.get().getDurTime() >= Utils.getCurrentSeconds() && !isFastFinish) {
|
||||
// player.getSession().send(new PacketTakeFurnitureMakeRsp(Retcode.RET_FURNITURE_MAKE_UNFINISH_VALUE, makeId, null, null));
|
||||
// return;
|
||||
// }
|
||||
|
||||
Reference in New Issue
Block a user