本文整理汇总了Java中net.minecraft.util.datafix.DataFixer类的典型用法代码示例。如果您正苦于以下问题:Java DataFixer类的具体用法?Java DataFixer怎么用?Java DataFixer使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
DataFixer类属于net.minecraft.util.datafix包,在下文中一共展示了DataFixer类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: SaveHandler
import net.minecraft.util.datafix.DataFixer; //导入依赖的package包/类
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();
}
示例2: SaveHandler
import net.minecraft.util.datafix.DataFixer; //导入依赖的package包/类
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();
}
示例3: DedicatedServer
import net.minecraft.util.datafix.DataFixer; //导入依赖的package包/类
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)
{
;
}
}
}
};
}
示例4: func_191158_a
import net.minecraft.util.datafix.DataFixer; //导入依赖的package包/类
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;
}
});
}
示例5: SaveFormatOld
import net.minecraft.util.datafix.DataFixer; //导入依赖的package包/类
public SaveFormatOld(File savesDirectoryIn, DataFixer dataFixerIn)
{
this.dataFixer = dataFixerIn;
if (!savesDirectoryIn.exists())
{
savesDirectoryIn.mkdirs();
}
this.savesDirectory = savesDirectoryIn;
}
示例6: getWorldData
import net.minecraft.util.datafix.DataFixer; //导入依赖的package包/类
@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;
}
}
示例7: MinecraftServer
import net.minecraft.util.datafix.DataFixer; //导入依赖的package包/类
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;
}
示例8: HarshenTemplate
import net.minecraft.util.datafix.DataFixer; //导入依赖的package包/类
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);
}
}
示例9: getDataFixer
import net.minecraft.util.datafix.DataFixer; //导入依赖的package包/类
public DataFixer getDataFixer()
{
return this.dataFixer;
}
示例10: registerFixesThrowable
import net.minecraft.util.datafix.DataFixer; //导入依赖的package包/类
public static void registerFixesThrowable(DataFixer p_189663_0_) {
EntityThrowable.registerFixesThrowable(p_189663_0_, "ThrownFrienderpearl");
}
示例11: registerFixesMagmaCube
import net.minecraft.util.datafix.DataFixer; //导入依赖的package包/类
public static void registerFixesMagmaCube(DataFixer fixer)
{
EntityLiving.registerFixesMob(fixer, "LavaSlime");
}
示例12: registerFixesChest
import net.minecraft.util.datafix.DataFixer; //导入依赖的package包/类
public static void registerFixesChest(DataFixer fixer)
{
fixer.registerWalker(FixTypes.BLOCK_ENTITY, new ItemStackDataLists("Chest", new String[] {"Items"}));
}
示例13: registerFixesMinecartHopper
import net.minecraft.util.datafix.DataFixer; //导入依赖的package包/类
public static void registerFixesMinecartHopper(DataFixer fixer)
{
EntityMinecartContainer.registerFixesMinecartContainer(fixer, "MinecartHopper");
}
示例14: registerFixesEnderman
import net.minecraft.util.datafix.DataFixer; //导入依赖的package包/类
public static void registerFixesEnderman(DataFixer fixer)
{
EntityLiving.registerFixesMob(fixer, "Enderman");
}
示例15: registerFixesMinecartFurnace
import net.minecraft.util.datafix.DataFixer; //导入依赖的package包/类
public static void registerFixesMinecartFurnace(DataFixer fixer)
{
EntityMinecart.registerFixesMinecart(fixer, EntityMinecartFurnace.class);
}