本文整理汇总了Java中net.minecraft.network.play.client.CPacketResourcePackStatus类的典型用法代码示例。如果您正苦于以下问题:Java CPacketResourcePackStatus类的具体用法?Java CPacketResourcePackStatus怎么用?Java CPacketResourcePackStatus使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
CPacketResourcePackStatus类属于net.minecraft.network.play.client包,在下文中一共展示了CPacketResourcePackStatus类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: validateResourcePackUrl
import net.minecraft.network.play.client.CPacketResourcePackStatus; //导入依赖的package包/类
private boolean validateResourcePackUrl(String p_189688_1_)
{
try
{
URI uri = new URI(p_189688_1_);
String s = uri.getScheme();
boolean flag = "level".equals(s);
if (!"http".equals(s) && !"https".equals(s) && !flag)
{
throw new URISyntaxException(p_189688_1_, "Wrong protocol");
}
else if (!flag || !p_189688_1_.contains("..") && p_189688_1_.endsWith("/resources.zip"))
{
return true;
}
else
{
throw new URISyntaxException(p_189688_1_, "Invalid levelstorage resourcepack path");
}
}
catch (URISyntaxException var5)
{
this.netManager.sendPacket(new CPacketResourcePackStatus(CPacketResourcePackStatus.Action.FAILED_DOWNLOAD));
return false;
}
}
开发者ID:NSExceptional,项目名称:Zombe-Modpack,代码行数:28,代码来源:NetHandlerPlayClient.java
示例2: createDownloadCallback
import net.minecraft.network.play.client.CPacketResourcePackStatus; //导入依赖的package包/类
private FutureCallback<Object> createDownloadCallback()
{
return new FutureCallback<Object>()
{
public void onSuccess(@Nullable Object p_onSuccess_1_)
{
NetHandlerPlayClient.this.netManager.sendPacket(new CPacketResourcePackStatus(CPacketResourcePackStatus.Action.SUCCESSFULLY_LOADED));
}
public void onFailure(Throwable p_onFailure_1_)
{
NetHandlerPlayClient.this.netManager.sendPacket(new CPacketResourcePackStatus(CPacketResourcePackStatus.Action.FAILED_DOWNLOAD));
}
};
}
开发者ID:NSExceptional,项目名称:Zombe-Modpack,代码行数:15,代码来源:NetHandlerPlayClient.java
示例3: validateResourcePackUrl
import net.minecraft.network.play.client.CPacketResourcePackStatus; //导入依赖的package包/类
private boolean validateResourcePackUrl(String p_189688_1_)
{
try
{
URI uri = new URI(p_189688_1_.replace(' ', '+'));
String s = uri.getScheme();
boolean flag = "level".equals(s);
if (!"http".equals(s) && !"https".equals(s) && !flag)
{
throw new URISyntaxException(p_189688_1_, "Wrong protocol");
}
else if (!flag || !p_189688_1_.contains("..") && p_189688_1_.endsWith("/resources.zip"))
{
return true;
}
else
{
throw new URISyntaxException(p_189688_1_, "Invalid levelstorage resourcepack path");
}
}
catch (URISyntaxException var5)
{
this.netManager.sendPacket(new CPacketResourcePackStatus(CPacketResourcePackStatus.Action.FAILED_DOWNLOAD));
return false;
}
}
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:28,代码来源:NetHandlerPlayClient.java
示例4: func_189688_b
import net.minecraft.network.play.client.CPacketResourcePackStatus; //导入依赖的package包/类
private boolean func_189688_b(String p_189688_1_)
{
try
{
URI uri = new URI(p_189688_1_.replace(' ', '+'));
String s = uri.getScheme();
boolean flag = "level".equals(s);
if (!"http".equals(s) && !"https".equals(s) && !flag)
{
throw new URISyntaxException(p_189688_1_, "Wrong protocol");
}
else if (!flag || !p_189688_1_.contains("..") && p_189688_1_.endsWith("/resources.zip"))
{
return true;
}
else
{
throw new URISyntaxException(p_189688_1_, "Invalid levelstorage resourcepack path");
}
}
catch (URISyntaxException var5)
{
this.netManager.sendPacket(new CPacketResourcePackStatus(CPacketResourcePackStatus.Action.FAILED_DOWNLOAD));
return false;
}
}
开发者ID:BlazeAxtrius,项目名称:ExpandedRailsMod,代码行数:28,代码来源:NetHandlerPlayClient.java
示例5: func_189686_f
import net.minecraft.network.play.client.CPacketResourcePackStatus; //导入依赖的package包/类
private FutureCallback<Object> func_189686_f()
{
return new FutureCallback<Object>()
{
public void onSuccess(@Nullable Object p_onSuccess_1_)
{
NetHandlerPlayClient.this.netManager.sendPacket(new CPacketResourcePackStatus(CPacketResourcePackStatus.Action.SUCCESSFULLY_LOADED));
}
public void onFailure(Throwable p_onFailure_1_)
{
NetHandlerPlayClient.this.netManager.sendPacket(new CPacketResourcePackStatus(CPacketResourcePackStatus.Action.FAILED_DOWNLOAD));
}
};
}
开发者ID:BlazeAxtrius,项目名称:ExpandedRailsMod,代码行数:15,代码来源:NetHandlerPlayClient.java
示例6: handleResourcePackStatus
import net.minecraft.network.play.client.CPacketResourcePackStatus; //导入依赖的package包/类
public void handleResourcePackStatus(CPacketResourcePackStatus packetIn)
{
}
开发者ID:NSExceptional,项目名称:Zombe-Modpack,代码行数:4,代码来源:NetHandlerPlayServer.java
示例7: handleResourcePack
import net.minecraft.network.play.client.CPacketResourcePackStatus; //导入依赖的package包/类
public void handleResourcePack(SPacketResourcePackSend packetIn)
{
final String s = packetIn.getURL();
final String s1 = packetIn.getHash();
if (this.validateResourcePackUrl(s))
{
if (s.startsWith("level://"))
{
String s2 = s.substring("level://".length());
File file1 = new File(this.gameController.mcDataDir, "saves");
File file2 = new File(file1, s2);
if (file2.isFile())
{
this.netManager.sendPacket(new CPacketResourcePackStatus(CPacketResourcePackStatus.Action.ACCEPTED));
Futures.addCallback(this.gameController.getResourcePackRepository().setResourcePackInstance(file2), this.createDownloadCallback());
}
else
{
this.netManager.sendPacket(new CPacketResourcePackStatus(CPacketResourcePackStatus.Action.FAILED_DOWNLOAD));
}
}
else
{
ServerData serverdata = this.gameController.getCurrentServerData();
if (serverdata != null && serverdata.getResourceMode() == ServerData.ServerResourceMode.ENABLED)
{
this.netManager.sendPacket(new CPacketResourcePackStatus(CPacketResourcePackStatus.Action.ACCEPTED));
Futures.addCallback(this.gameController.getResourcePackRepository().downloadResourcePack(s, s1), this.createDownloadCallback());
}
else if (serverdata != null && serverdata.getResourceMode() != ServerData.ServerResourceMode.PROMPT)
{
this.netManager.sendPacket(new CPacketResourcePackStatus(CPacketResourcePackStatus.Action.DECLINED));
}
else
{
this.gameController.addScheduledTask(new Runnable()
{
public void run()
{
NetHandlerPlayClient.this.gameController.displayGuiScreen(new GuiYesNo(new GuiYesNoCallback()
{
public void confirmClicked(boolean result, int id)
{
NetHandlerPlayClient.this.gameController = Minecraft.getMinecraft();
ServerData serverdata1 = NetHandlerPlayClient.this.gameController.getCurrentServerData();
if (result)
{
if (serverdata1 != null)
{
serverdata1.setResourceMode(ServerData.ServerResourceMode.ENABLED);
}
NetHandlerPlayClient.this.netManager.sendPacket(new CPacketResourcePackStatus(CPacketResourcePackStatus.Action.ACCEPTED));
Futures.addCallback(NetHandlerPlayClient.this.gameController.getResourcePackRepository().downloadResourcePack(s, s1), NetHandlerPlayClient.this.createDownloadCallback());
}
else
{
if (serverdata1 != null)
{
serverdata1.setResourceMode(ServerData.ServerResourceMode.DISABLED);
}
NetHandlerPlayClient.this.netManager.sendPacket(new CPacketResourcePackStatus(CPacketResourcePackStatus.Action.DECLINED));
}
ServerList.saveSingleServer(serverdata1);
NetHandlerPlayClient.this.gameController.displayGuiScreen((GuiScreen)null);
}
}, I18n.format("multiplayer.texturePrompt.line1", new Object[0]), I18n.format("multiplayer.texturePrompt.line2", new Object[0]), 0));
}
});
}
}
}
}
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:80,代码来源:NetHandlerPlayClient.java
示例8: handleResourcePackStatus
import net.minecraft.network.play.client.CPacketResourcePackStatus; //导入依赖的package包/类
@Override
public void handleResourcePackStatus(CPacketResourcePackStatus packetIn) {
}
开发者ID:Alec-WAM,项目名称:CrystalMod,代码行数:4,代码来源:FakeNetHandlerPlayServer.java
示例9: handleResourcePack
import net.minecraft.network.play.client.CPacketResourcePackStatus; //导入依赖的package包/类
public void handleResourcePack(SPacketResourcePackSend packetIn)
{
final String s = packetIn.getURL();
final String s1 = packetIn.getHash();
if (this.func_189688_b(s))
{
if (s.startsWith("level://"))
{
String s2 = s.substring("level://".length());
File file1 = new File(this.gameController.mcDataDir, "saves");
File file2 = new File(file1, s2);
if (file2.isFile())
{
this.netManager.sendPacket(new CPacketResourcePackStatus(CPacketResourcePackStatus.Action.ACCEPTED));
Futures.addCallback(this.gameController.getResourcePackRepository().setResourcePackInstance(file2), this.func_189686_f());
}
else
{
this.netManager.sendPacket(new CPacketResourcePackStatus(CPacketResourcePackStatus.Action.FAILED_DOWNLOAD));
}
}
else
{
ServerData serverdata = this.gameController.getCurrentServerData();
if (serverdata != null && serverdata.getResourceMode() == ServerData.ServerResourceMode.ENABLED)
{
this.netManager.sendPacket(new CPacketResourcePackStatus(CPacketResourcePackStatus.Action.ACCEPTED));
Futures.addCallback(this.gameController.getResourcePackRepository().downloadResourcePack(s, s1), this.func_189686_f());
}
else if (serverdata != null && serverdata.getResourceMode() != ServerData.ServerResourceMode.PROMPT)
{
this.netManager.sendPacket(new CPacketResourcePackStatus(CPacketResourcePackStatus.Action.DECLINED));
}
else
{
this.gameController.addScheduledTask(new Runnable()
{
public void run()
{
NetHandlerPlayClient.this.gameController.displayGuiScreen(new GuiYesNo(new GuiYesNoCallback()
{
public void confirmClicked(boolean result, int id)
{
NetHandlerPlayClient.this.gameController = Minecraft.getMinecraft();
ServerData serverdata1 = NetHandlerPlayClient.this.gameController.getCurrentServerData();
if (result)
{
if (serverdata1 != null)
{
serverdata1.setResourceMode(ServerData.ServerResourceMode.ENABLED);
}
NetHandlerPlayClient.this.netManager.sendPacket(new CPacketResourcePackStatus(CPacketResourcePackStatus.Action.ACCEPTED));
Futures.addCallback(NetHandlerPlayClient.this.gameController.getResourcePackRepository().downloadResourcePack(s, s1), NetHandlerPlayClient.this.func_189686_f());
}
else
{
if (serverdata1 != null)
{
serverdata1.setResourceMode(ServerData.ServerResourceMode.DISABLED);
}
NetHandlerPlayClient.this.netManager.sendPacket(new CPacketResourcePackStatus(CPacketResourcePackStatus.Action.DECLINED));
}
ServerList.saveSingleServer(serverdata1);
NetHandlerPlayClient.this.gameController.displayGuiScreen((GuiScreen)null);
}
}, I18n.format("multiplayer.texturePrompt.line1", new Object[0]), I18n.format("multiplayer.texturePrompt.line2", new Object[0]), 0));
}
});
}
}
}
}
开发者ID:BlazeAxtrius,项目名称:ExpandedRailsMod,代码行数:80,代码来源:NetHandlerPlayClient.java
示例10: handleResourcePackStatus
import net.minecraft.network.play.client.CPacketResourcePackStatus; //导入依赖的package包/类
@Override
public void handleResourcePackStatus(@Nonnull CPacketResourcePackStatus packetIn) {
}
开发者ID:SleepyTrousers,项目名称:EnderIO,代码行数:4,代码来源:FakeNetHandlerPlayServer.java
示例11: handleResourcePackStatus
import net.minecraft.network.play.client.CPacketResourcePackStatus; //导入依赖的package包/类
@Override
public void handleResourcePackStatus(CPacketResourcePackStatus packetIn) {
}
开发者ID:p455w0rd,项目名称:DankNull,代码行数:5,代码来源:NetServerHandlerFake.java
示例12: handleResourcePackStatus
import net.minecraft.network.play.client.CPacketResourcePackStatus; //导入依赖的package包/类
void handleResourcePackStatus(CPacketResourcePackStatus packetIn);
开发者ID:sudofox,项目名称:Backmemed,代码行数:2,代码来源:INetHandlerPlayServer.java
注:本文中的net.minecraft.network.play.client.CPacketResourcePackStatus类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论