-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
78 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
66 changes: 66 additions & 0 deletions
66
src/main/java/nightkosh/gravestone/helper/BackupsHandler.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
package nightkosh.gravestone.helper; | ||
|
||
import net.minecraft.item.ItemStack; | ||
import net.minecraft.util.math.BlockPos; | ||
|
||
import java.util.ArrayList; | ||
import java.util.HashMap; | ||
import java.util.List; | ||
import java.util.Map; | ||
|
||
/** | ||
* GraveStone mod | ||
* | ||
* @author NightKosh | ||
* @license Lesser GNU Public License v3 (http://www.gnu.org/licenses/lgpl.html) | ||
*/ | ||
public class BackupsHandler { | ||
|
||
public static final Map<String, Backup> BACKUPS = new HashMap<>(); | ||
|
||
public static class Backup { | ||
private int dimensionId; | ||
|
||
private BlockPos pos; | ||
|
||
private List<ItemStack> items = new ArrayList<>(); | ||
|
||
public Backup() { | ||
|
||
} | ||
|
||
public Backup(int dimensionId, BlockPos pos, List<ItemStack> items) { | ||
this.dimensionId = dimensionId; | ||
this.pos = pos; | ||
setItems(items); | ||
} | ||
|
||
public int getDimensionId() { | ||
return dimensionId; | ||
} | ||
|
||
public void setDimensionId(int dimensionId) { | ||
this.dimensionId = dimensionId; | ||
} | ||
|
||
public BlockPos getPos() { | ||
return pos; | ||
} | ||
|
||
public void setPos(BlockPos pos) { | ||
this.pos = pos; | ||
} | ||
|
||
public List<ItemStack> getItems() { | ||
return items; | ||
} | ||
|
||
public void setItems(List<ItemStack> items) { | ||
for (ItemStack stack : items) { | ||
if (stack != null && !stack.isEmpty()) { | ||
this.items.add(stack.copy()); | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters