@Override
public void postInit(FMLPostInitializationEvent event) {
byte[] defaultBIOSImage = null;
IResourceManager rm = Minecraft.getMinecraft().getResourceManager();
try {
IResource res = rm.getResource(new ResourceLocation("ocmos", "ocmosbios.cabe"));
InputStream stream = res.getInputStream();
byte[] buf = new byte[4096];
int len = stream.read(buf);
if(len <= 6)
MainClass.logger.error("ocmosbios.cabe is too small to possibly be valid");
else {
defaultBIOSImage = Arrays.copyOf(buf, len);
MainClass.logger.info("Found ocmosbios.cabe");
}
}
catch(IOException e) {
MainClass.logger.error("IOException while loading ocmosbios.cabe", e);
}
if(defaultBIOSImage != null) {
MainClass.setDefaultBIOSImage(defaultBIOSImage);
Items.registerEEPROM("EEPROM (OCMOS BIOS)", defaultBIOSImage, null, false);
// TODO: Get this to work some day, behind a config option
/*
ItemStack stack = new ItemStack(Items.get("eeprom").item());
NBTTagCompound compound = new NBTTagCompound();
compound.setByteArray("oc:eeprom", defaultBIOSImage);
compound.setString("oc:label", "EEPROM (OCMOS BIOS)");
stack.setTagCompound(compound);
GameRegistry.addShapelessRecipe(stack, Items.get("eeprom").item(), net.minecraft.init.Items.feather);
*/
}
}
ClientProxy.java 文件源码
java
阅读 21
收藏 0
点赞 0
评论 0
项目:j6502
作者:
评论列表
文章目录