mirror of
https://github.com/GTNewHorizons/JustEnoughCalculation.git
synced 2026-11-21 04:22:20 +00:00
Almost done with record saving! Moved nearly all the files
This commit is contained in:
1 parent
d29aa0622d
commit
e891649d92
43 files changed
+228
-191
No files matched your search
@@ -0,0 +1,86 @@
|
||||
package pers.towdium.justEnoughCalculation.network;
|
||||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.event.entity.player.PlayerEvent;
|
||||
import pers.towdium.justEnoughCalculation.JustEnoughCalculation;
|
||||
import pers.towdium.justEnoughCalculation.core.Recipe;
|
||||
import pers.towdium.justEnoughCalculation.network.packets.PacketSyncRecord;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author Towdium
|
||||
*/
|
||||
public class PlayerHandlerServer implements IPlayerHandler {
|
||||
HashMap<UUID, PlayerHandlerClient> players = new HashMap<>();
|
||||
|
||||
@Override
|
||||
public boolean getHasRecipeOf(ItemStack itemStack, UUID uuid) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Recipe getRecipeOf(ItemStack itemStack, UUID uuid) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ImmutableList<Recipe> getAllRecipeOf(ItemStack itemStack, UUID uuid) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRecipeIndexOf(ItemStack itemStack, UUID uuid) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ImmutableList<Integer> getAllRecipeIndexOf(ItemStack itemStack, UUID uuid) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addRecipe(Recipe recipe, UUID uuid) {
|
||||
players.get(uuid).addRecipe(recipe, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeRecipe(int index, UUID uuid) {
|
||||
players.get(uuid).removeRecipe(index, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRecipe(Recipe recipe, int index, UUID uuid) {
|
||||
players.get(uuid).setRecipe(recipe, index, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Recipe getRecipe(int index, UUID uuid) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void syncItemCalculator(ItemStack itemIn, String string) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handleLogin(PlayerEvent.LoadFromFile event) {
|
||||
PlayerHandlerClient client = new PlayerHandlerClient();
|
||||
client.handleLogin(event);
|
||||
players.put(event.entityPlayer.getUniqueID(), client);
|
||||
//JustEnoughCalculation.networkWrapper.sendTo(new PacketSyncRecord(client), ((EntityPlayerMP) event.entityPlayer));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handleSave(PlayerEvent.SaveToFile event) {
|
||||
players.get(UUID.fromString(event.playerUUID)).handleSave(event);
|
||||
}
|
||||
|
||||
public PlayerHandlerClient getClient(UUID uuid){
|
||||
return players.get(uuid);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user