use of net.minecraft.util.ResourceLocation in project ImmersiveEngineering by BluSunrize.
the class BotaniaHelper method init.
@Override
public void init() {
BlueprintCraftingRecipe.addRecipe("specialBullet", BulletHandler.getBulletStack("terrasteel"), new ItemStack(IEContent.itemBullet, 1, 0), Items.GUNPOWDER, "nuggetTerrasteel", "nuggetTerrasteel");
try {
Class c_BotaniaAPI = Class.forName("vazkii.botania.api.BotaniaAPI");
Method m_blacklistBlockFromMagnet = c_BotaniaAPI.getDeclaredMethod("blacklistBlockFromMagnet", Block.class, int.class);
m_blacklistBlockFromMagnet.invoke(null, IEContent.blockConveyor, 0);
} catch (Exception e) {
IELogger.error("[Botania] Failed to protect IE conveyors against Botania's magnets");
e.printStackTrace();
}
rariryRelic = EnumRarity.valueOf("RELIC");
if (rariryRelic != null) {
ShaderRegistry.rarityWeightMap.put(rariryRelic, 2);
makeShaderRelic("The Kindled");
makeShaderRelic("Dark Fire");
ShaderRegistryEntry entry = ItemShader.addShader("Terra", 1, rariryRelic, 0xff3e2d14, 0xff2b1108, 0xff41bd1a, 0xff2e120a).setInfo(null, "Botania", "terra");
entry.getCase("immersiveengineering:revolver").addLayers(new ShaderLayer(new ResourceLocation("botania:blocks/livingwood5"), 0xffffffff).setTextureBounds(17 / 128d, 24 / 128d, 33 / 128d, 40 / 128d));
entry.getCase("immersiveengineering:drill").addLayers(new ShaderLayer(new ResourceLocation("botania:blocks/alfheimPortalInside"), 0xffffffff).setTextureBounds(14 / 64d, 10 / 64d, 26 / 64d, 22 / 64d));
entry.getCase("immersiveengineering:railgun").addLayers(new ShaderLayer(new ResourceLocation("botania:blocks/storage1"), 0xff9e83eb).setTextureBounds(55 / 64d, 42 / 64d, 1, 58 / 64d).setCutoutBounds(.1875, 0, .75, 1));
}
if (FMLCommonHandler.instance().getEffectiveSide() == Side.CLIENT)
MinecraftForge.EVENT_BUS.register(this);
}
use of net.minecraft.util.ResourceLocation in project NetherEx by LogicTechCorp.
the class AdditionalBiomeManager method init.
public static void init(File directory) {
try {
if (!directory.exists()) {
directory.mkdir();
}
LOGGER.info("Copying the Biome List Directory to the config folder.");
if (NetherEx.IS_DEV_ENV) {
FileUtils.copyDirectory(new File(NetherEx.class.getResource("/assets/nex/biome_lists").getFile()), directory);
} else {
FileUtil.extractFromJar("/assets/nex/biome_lists", directory.getPath());
}
} catch (IOException e) {
LOGGER.fatal("The attempt to copy the Biome List Directory to the config folder was unsuccessful.");
LOGGER.fatal(e);
}
Gson gson = new Gson();
List<File> additionalBiomeFiles = Lists.newArrayList(directory.listFiles());
try {
for (File additionalBiomeFile : additionalBiomeFiles) {
String jsonText = Files.toString(additionalBiomeFile, Charsets.UTF_8);
AdditionalBiomeList biomeList = gson.fromJson(jsonText, AdditionalBiomeList.class);
LOGGER.info("Adding biomes from the " + biomeList.getName() + ".");
for (AdditionalBiomeMod biomeMod : biomeList.getMods()) {
for (AdditionalBiome additionalBiome : biomeMod.getBiomes()) {
ResourceLocation biomeRegistryName = new ResourceLocation(biomeMod.getName() + ":" + additionalBiome.getName());
Biome biome = Biome.REGISTRY.getObject(biomeRegistryName);
if (biome == null) {
continue;
}
int weight = additionalBiome.getWeight();
AdditionalBiome.OceanBlock oceanBlock = additionalBiome.getOceanBlock();
if (oceanBlock == null) {
oceanBlock = new AdditionalBiome.OceanBlock("minecraft:air", 0);
}
Block block = Block.getBlockFromName(oceanBlock.getName().isEmpty() ? "minecraft:air" : oceanBlock.getName());
int meta = oceanBlock.getMeta();
IBlockState state = block.getStateFromMeta(meta);
NetherExBiomeType type = NetherExBiomeType.getFromString(additionalBiome.getType());
NetherExBiomes.addBiome(biome, weight, state, type);
LOGGER.info("The " + biome.getBiomeName() + " biome from the " + biomeList.getName() + " was added to the Nether.");
}
}
}
} catch (IOException e) {
LOGGER.fatal("NetherEx was unable to read the Biome lists.");
LOGGER.fatal(e);
}
}
use of net.minecraft.util.ResourceLocation in project RFToolsDimensions by McJty.
the class SkyRenderer method registerSkybox.
public static void registerSkybox(GenericWorldProvider provider, final SkyType skyType) {
provider.setSkyRenderer(new IRenderHandler() {
@Override
public void render(float partialTicks, WorldClient world, Minecraft mc) {
ResourceLocation sky;
ResourceLocation sky2 = null;
int type = SKYTYPE_DARKTOP;
switch(skyType) {
case SKY_INFERNO:
sky = locationPlasmaSkyPng;
type = SKYTYPE_DARKTOP;
break;
case SKY_STARS1:
sky = locationStars1;
sky2 = locationStars1a;
type = SKYTYPE_ALTERNATING;
break;
case SKY_STARS2:
sky = locationStars2;
type = SKYTYPE_ALL;
break;
case SKY_STARS3:
sky = locationStars3;
sky2 = locationStars3a;
type = SKYTYPE_ALLHORIZONTAL;
break;
default:
return;
}
SkyRenderer.renderSkyTexture(sky, sky2, type);
}
});
provider.setCloudRenderer(new IRenderHandler() {
@Override
public void render(float partialTicks, WorldClient world, Minecraft mc) {
}
});
}
use of net.minecraft.util.ResourceLocation in project ImmersiveEngineering by BluSunrize.
the class BlockConveyor method onIEBlockPlacedBy.
@Override
public void onIEBlockPlacedBy(World world, BlockPos pos, IBlockState state, EnumFacing side, float hitX, float hitY, float hitZ, EntityLivingBase placer, ItemStack stack) {
super.onIEBlockPlacedBy(world, pos, state, side, hitX, hitY, hitZ, placer, stack);
TileEntity tile = world.getTileEntity(pos);
if (tile instanceof TileEntityConveyorBelt && !(tile instanceof TileEntityConveyorVertical)) {
TileEntityConveyorBelt conveyor = (TileEntityConveyorBelt) tile;
EnumFacing f = conveyor.facing;
ResourceLocation rl = new ResourceLocation(ItemNBTHelper.getString(stack, "conveyorType"));
IConveyorBelt subType = ConveyorHandler.getConveyor(rl, conveyor);
conveyor.setConveyorSubtype(subType);
tile = world.getTileEntity(pos.offset(f));
TileEntity tileUp = world.getTileEntity(pos.offset(f).add(0, 1, 0));
if (subType != null && (!(tile instanceof IConveyorTile) || ((IConveyorTile) tile).getFacing() == f.getOpposite()) && tileUp instanceof IConveyorTile && ((IConveyorTile) tileUp).getFacing() != f.getOpposite() && world.isAirBlock(pos.add(0, 1, 0)))
subType.setConveyorDirection(ConveyorDirection.UP);
tile = world.getTileEntity(pos.offset(f.getOpposite()).add(0, 1, 0));
// if(tile instanceof TileEntityConveyorBelt&&!(tile instanceof TileEntityConveyorVertical) && ((TileEntityConveyorBelt)tile).facing==f)
// conveyor.transportDown = true;
// if(conveyor.transportUp && conveyor.transportDown)
// conveyor.transportDown = false;
}
}
use of net.minecraft.util.ResourceLocation in project ImmersiveEngineering by BluSunrize.
the class BlockConveyor method getSubBlocks.
@Override
public void getSubBlocks(Item itemIn, CreativeTabs tab, List<ItemStack> list) {
for (ResourceLocation key : ConveyorHandler.classRegistry.keySet()) {
ItemStack stack = new ItemStack(this);
ItemNBTHelper.setString(stack, "conveyorType", key.toString());
list.add(stack);
}
}
Aggregations