public SaveHandler(File p_i46648_1_, String saveDirectoryNameIn, boolean p_i46648_3_, DataFixer dataFixerIn) { this.dataFixer = dataFixerIn; this.worldDirectory = new File(p_i46648_1_, saveDirectoryNameIn); this.worldDirectory.mkdirs(); this.playersDirectory = new File(this.worldDirectory, "playerdata"); this.mapDataDir = new File(this.worldDirectory, "data"); this.mapDataDir.mkdirs(); this.saveDirectoryName = saveDirectoryNameIn; if (p_i46648_3_) { this.playersDirectory.mkdirs(); this.structureTemplateManager = new TemplateManager((new File(this.worldDirectory, "structures")).toString(), dataFixerIn); } else { this.structureTemplateManager = null; } this.setSessionLock(); }
public SaveHandler(File p_i46648_1_, String saveDirectoryNameIn, boolean p_i46648_3_, DataFixer dataFixerIn) { this.dataFixer = dataFixerIn; this.worldDirectory = new File(p_i46648_1_, saveDirectoryNameIn); this.worldDirectory.mkdirs(); this.playersDirectory = new File(this.worldDirectory, "playerdata"); this.mapDataDir = new File(this.worldDirectory, "data"); this.mapDataDir.mkdirs(); this.saveDirectoryName = saveDirectoryNameIn; if (p_i46648_3_) { this.playersDirectory.mkdirs(); this.structureTemplateManager = new TemplateManager((new File(this.worldDirectory, "structures")).toString()); } else { this.structureTemplateManager = null; } this.setSessionLock(); }
public DedicatedServer(File anvilFileIn, DataFixer dataFixerIn, YggdrasilAuthenticationService authServiceIn, MinecraftSessionService sessionServiceIn, GameProfileRepository profileRepoIn, PlayerProfileCache profileCacheIn) { super(anvilFileIn, Proxy.NO_PROXY, dataFixerIn, authServiceIn, sessionServiceIn, profileRepoIn, profileCacheIn); Thread thread = new Thread("Server Infinisleeper") { { this.setDaemon(true); this.start(); } public void run() { while (true) { try { Thread.sleep(2147483647L); } catch (InterruptedException var2) { ; } } } }; }
public static void func_191158_a(DataFixer p_191158_0_) { p_191158_0_.registerWalker(FixTypes.STRUCTURE, new IDataWalker() { public NBTTagCompound process(IDataFixer fixer, NBTTagCompound compound, int versionIn) { if (compound.hasKey("entities", 9)) { NBTTagList nbttaglist = compound.getTagList("entities", 10); for (int i = 0; i < nbttaglist.tagCount(); ++i) { NBTTagCompound nbttagcompound = (NBTTagCompound)nbttaglist.get(i); if (nbttagcompound.hasKey("nbt", 10)) { nbttagcompound.setTag("nbt", fixer.process(FixTypes.ENTITY, nbttagcompound.getCompoundTag("nbt"), versionIn)); } } } if (compound.hasKey("blocks", 9)) { NBTTagList nbttaglist1 = compound.getTagList("blocks", 10); for (int j = 0; j < nbttaglist1.tagCount(); ++j) { NBTTagCompound nbttagcompound1 = (NBTTagCompound)nbttaglist1.get(j); if (nbttagcompound1.hasKey("nbt", 10)) { nbttagcompound1.setTag("nbt", fixer.process(FixTypes.BLOCK_ENTITY, nbttagcompound1.getCompoundTag("nbt"), versionIn)); } } } return compound; } }); }
public SaveFormatOld(File savesDirectoryIn, DataFixer dataFixerIn) { this.dataFixer = dataFixerIn; if (!savesDirectoryIn.exists()) { savesDirectoryIn.mkdirs(); } this.savesDirectory = savesDirectoryIn; }
@Nullable public static WorldInfo getWorldData(File p_186353_0_, DataFixer dataFixerIn) { try { NBTTagCompound nbttagcompound = CompressedStreamTools.readCompressed(new FileInputStream(p_186353_0_)); NBTTagCompound nbttagcompound1 = nbttagcompound.getCompoundTag("Data"); return new WorldInfo(dataFixerIn.process(FixTypes.LEVEL, nbttagcompound1)); } catch (Exception exception) { LOGGER.error("Exception reading {}", new Object[] {p_186353_0_, exception}); return null; } }
public MinecraftServer(File anvilFileIn, Proxy proxyIn, DataFixer dataFixerIn, YggdrasilAuthenticationService authServiceIn, MinecraftSessionService sessionServiceIn, GameProfileRepository profileRepoIn, PlayerProfileCache profileCacheIn) { this.serverProxy = proxyIn; this.authService = authServiceIn; this.sessionService = sessionServiceIn; this.profileRepo = profileRepoIn; this.profileCache = profileCacheIn; this.anvilFile = anvilFileIn; this.networkSystem = new NetworkSystem(this); this.commandManager = this.createNewCommandManager(); this.anvilConverterForAnvilFile = new AnvilSaveConverter(anvilFileIn, dataFixerIn); this.dataFixer = dataFixerIn; }
protected HarshenTemplate(ResourceLocation location) { String s = location.getResourceDomain(); String s1 = location.getResourcePath(); InputStream stream = null; boolean flag; try { stream = getClass().getResourceAsStream("/assets/" + HarshenCastle.MODID + "/structures/" + s1 + ".nbt"); NBTTagCompound compound = CompressedStreamTools.readCompressed(stream); if (!compound.hasKey("DataVersion", 99)) { compound.setInteger("DataVersion", 500); } Template template = new Template(); DataFixer fixer; try { fixer = Minecraft.getMinecraft().getDataFixer(); } catch (Throwable e) { fixer = FMLServerHandler.instance().getDataFixer(); } template.read(fixer.process(FixTypes.STRUCTURE, compound)); this.blocks.clear(); NBTTagList nbttaglist = compound.getTagList("size", 3); this.size = new BlockPos(nbttaglist.getIntAt(0), nbttaglist.getIntAt(1), nbttaglist.getIntAt(2)); NBTTagList nbttaglist4 = compound.getTagList("pos", 3); if(nbttaglist4.hasNoTags()) this.pos = BlockPos.ORIGIN; else this.pos = new BlockPos(nbttaglist4.getIntAt(0), nbttaglist4.getIntAt(1), nbttaglist4.getIntAt(2)); BasicPalette template$basicpalette = new BasicPalette(); NBTTagList nbttaglist1 = compound.getTagList("palette", 10); for (int i = 0; i < nbttaglist1.tagCount(); ++i) { template$basicpalette.addMapping(NBTUtil.readBlockState(nbttaglist1.getCompoundTagAt(i)), i); } NBTTagList nbttaglist3 = compound.getTagList("blocks", 10); for (int j = 0; j < nbttaglist3.tagCount(); ++j) { NBTTagCompound nbttagcompound = nbttaglist3.getCompoundTagAt(j); NBTTagList nbttaglist2 = nbttagcompound.getTagList("pos", 3); BlockPos blockpos = new BlockPos(nbttaglist2.getIntAt(0), nbttaglist2.getIntAt(1), nbttaglist2.getIntAt(2)); IBlockState iblockstate = template$basicpalette.stateFor(nbttagcompound.getInteger("state")); NBTTagCompound nbttagcompound1; if (nbttagcompound.hasKey("nbt")) { nbttagcompound1 = nbttagcompound.getCompoundTag("nbt"); } else { nbttagcompound1 = null; } if(!(iblockstate.getBlock() instanceof BlockStructure)) this.blocks.add(new Template.BlockInfo(blockpos, iblockstate, nbttagcompound1)); } } catch (Throwable var10) { } finally { IOUtils.closeQuietly(stream); } }
public DataFixer getDataFixer() { return this.dataFixer; }
public static void registerFixesThrowable(DataFixer p_189663_0_) { EntityThrowable.registerFixesThrowable(p_189663_0_, "ThrownFrienderpearl"); }
public static void registerFixesMagmaCube(DataFixer fixer) { EntityLiving.registerFixesMob(fixer, "LavaSlime"); }
public static void registerFixesChest(DataFixer fixer) { fixer.registerWalker(FixTypes.BLOCK_ENTITY, new ItemStackDataLists("Chest", new String[] {"Items"})); }
public static void registerFixesMinecartHopper(DataFixer fixer) { EntityMinecartContainer.registerFixesMinecartContainer(fixer, "MinecartHopper"); }
public static void registerFixesEnderman(DataFixer fixer) { EntityLiving.registerFixesMob(fixer, "Enderman"); }
public static void registerFixesMinecartFurnace(DataFixer fixer) { EntityMinecart.registerFixesMinecart(fixer, EntityMinecartFurnace.class); }
public static void registerFixesGiantZombie(DataFixer fixer) { EntityLiving.registerFixesMob(fixer, "Giant"); }
public static void registerFixesMinecartTNT(DataFixer fixer) { EntityMinecart.registerFixesMinecart(fixer, EntityMinecartTNT.class); }
public static void registerFixesWitch(DataFixer fixer) { EntityLiving.registerFixesMob(fixer, "Witch"); }
public static void registerFixesMinecartTNT(DataFixer fixer) { EntityMinecart.registerFixesMinecart(fixer, "MinecartTNT"); }
public static void registerFixesMob(DataFixer fixer) { registerFixesMob(fixer, "Mob"); }
public static void registerFixesMooshroom(DataFixer fixer) { EntityLiving.registerFixesMob(fixer, "MushroomCow"); }
public static void registerFixesItemFrame(DataFixer fixer) { fixer.registerWalker(FixTypes.ENTITY, new ItemStackData(EntityItemFrame.class, new String[] {"Item"})); }
public static void registerFixesEnderPearl(DataFixer fixer) { EntityThrowable.registerFixesThrowable(fixer, "ThrownEnderpearl"); }
public static void registerFixesArmorStand(DataFixer fixer) { fixer.registerWalker(FixTypes.ENTITY, new ItemStackDataLists(EntityArmorStand.class, new String[] {"ArmorItems", "HandItems"})); }
public static void registerFixesWolf(DataFixer fixer) { EntityLiving.registerFixesMob(fixer, "Wolf"); }
public static void registerFixesMinecartHopper(DataFixer fixer) { EntityMinecartContainer.func_190574_b(fixer, EntityMinecartHopper.class); }
public static void registerFixesSilverfish(DataFixer fixer) { EntityLiving.registerFixesMob(fixer, "Silverfish"); }
public static void registerFixesMob(DataFixer fixer, Class<?> name) { fixer.registerWalker(FixTypes.ENTITY, new ItemStackDataLists(name, new String[] {"ArmorItems", "HandItems"})); }
public static void registerFixesSnowman(DataFixer fixer) { EntityLiving.registerFixesMob(fixer, "SnowMan"); }
public static void registerFixesBat(DataFixer fixer) { EntityLiving.registerFixesMob(fixer, "Bat"); }
public static void registerFixesWitherSkull(DataFixer fixer) { EntityFireball.registerFixesFireball(fixer, "WitherSkull"); }
public static void registerFixesSnowball(DataFixer fixer) { EntityThrowable.registerFixesThrowable(fixer, "Snowball"); }
public static void registerFixesPotion(DataFixer fixer) { EntityThrowable.registerFixesThrowable(fixer, "ThrownPotion"); fixer.registerWalker(FixTypes.ENTITY, new ItemStackData(EntityPotion.class, new String[] {"Potion"})); }
public static void registerFixesTippedArrow(DataFixer fixer) { EntityArrow.registerFixesArrow(fixer, "TippedArrow"); }
public static void registerFixesSpectralArrow(DataFixer fixer) { EntityArrow.registerFixesArrow(fixer, "SpectralArrow"); }
public static void registerFixesArrow(DataFixer fixer, String name) { }