use of net.minecraft.util.ResourceLocation in project Railcraft by Railcraft.
the class JSONModelRenderer method loadModels.
@SubscribeEvent
public void loadModels(TextureStitchEvent.Pre event) {
final TextureMap map = event.getMap();
for (ResourceLocation modelLocation : modelLocations) {
IModel model = ModelManager.getModel(modelLocation);
models.put(modelLocation, model);
model.getTextures().forEach(map::registerSprite);
}
}
use of net.minecraft.util.ResourceLocation in project Railcraft by Railcraft.
the class ModelManager method registerItemModel.
public static void registerItemModel(Item item, int meta, String domain, String json) {
ModelResourceLocation location = new ModelResourceLocation(new ResourceLocation(domain, json), "inventory");
registerItemModel(item, meta, location);
}
use of net.minecraft.util.ResourceLocation in project Railcraft by Railcraft.
the class OutfittedTrackModel method getDependencies.
@Override
public Collection<ResourceLocation> getDependencies() {
if (trackTypeModelsLocations.isEmpty()) {
for (TrackType trackType : TrackRegistry.TRACK_TYPE) {
for (BlockRailBase.EnumRailDirection shape : BlockTrackOutfitted.SHAPE.getAllowedValues()) {
trackTypeModelsLocations.add(getTrackTypeModelLocation(trackType, shape));
}
}
}
if (trackKitModelsLocations.isEmpty()) {
TrackRegistry.TRACK_KIT.stream().filter(t -> t.getRenderer() == TrackKit.Renderer.COMPOSITE).forEach(t -> {
EnumSet<BlockRailBase.EnumRailDirection> shapes = EnumSet.copyOf(BlockTrackOutfitted.SHAPE.getAllowedValues());
if (!t.isAllowedOnSlopes()) {
shapes.removeIf(s -> !TrackShapeHelper.isLevelStraight(s));
}
for (BlockRailBase.EnumRailDirection shape : shapes) {
for (int state = 0; state < t.getRenderStates(); state++) trackKitModelsLocations.add(getTrackKitModelLocation(t, shape, state));
}
});
}
if (unifiedModelsLocations.isEmpty()) {
TrackRegistry.TRACK_KIT.stream().filter(t -> t.getRenderer() == TrackKit.Renderer.UNIFIED).forEach(trackKit -> {
EnumSet<BlockRailBase.EnumRailDirection> shapes = EnumSet.copyOf(BlockTrackOutfitted.SHAPE.getAllowedValues());
if (!trackKit.isAllowedOnSlopes()) {
shapes.removeIf(s -> !TrackShapeHelper.isLevelStraight(s));
}
for (TrackType trackType : TrackRegistry.TRACK_TYPE) for (BlockRailBase.EnumRailDirection shape : shapes) {
for (int state = 0; state < trackKit.getRenderStates(); state++) unifiedModelsLocations.add(getUnifiedModelLocation(trackType, trackKit, shape, state));
}
});
}
if (models.isEmpty()) {
models.addAll(trackTypeModelsLocations);
models.addAll(trackKitModelsLocations);
models.addAll(unifiedModelsLocations);
}
return models;
}
use of net.minecraft.util.ResourceLocation in project Railcraft by Railcraft.
the class ThaumcraftPlugin method setupResearch.
public static void setupResearch() {
ResearchCategories.registerCategory(RESEARCH_CATEGORY, null, new ResourceLocation("railcraft", "textures/items/tool.crowbar.magic.png"), new ResourceLocation("thaumcraft", "textures/gui/gui_researchback.png"));
// Apothecaries Backpack
Item item = RailcraftItems.BACKPACK_APOTHECARY_T1.item();
if (item != null) {
IArcaneRecipe recipe = ThaumcraftApi.addArcaneCraftingRecipe("RC_ApothecariesBackpack", RailcraftItems.BACKPACK_APOTHECARY_T1.getStack(), new AspectList().add(Aspect.AIR, 16).add(Aspect.ORDER, 16), "X#X", "VYV", "X#X", '#', Blocks.WOOL, 'V', Items.GLASS_BOTTLE, 'X', Items.STRING, 'Y', "chestWood");
AspectList aspects = new AspectList();
aspects.add(Aspect.VOID, 3).add(Aspect.CRAFT, 3).add(Aspect.MOTION, 2);
ResearchItem backpack = new ResearchItemRC("RC_ApothecariesBackpack", ThaumcraftPlugin.RESEARCH_CATEGORY, aspects, 2, 0, 6, RailcraftItems.BACKPACK_APOTHECARY_T1.getStack());
backpack.setPages(ThaumcraftPlugin.getResearchPage("RC_ApothecariesBackpack"), new ResearchPage(recipe)).setParentsHidden("ENCHFABRIC").registerResearchItem();
}
// Thaumium Crowbar
item = RailcraftItems.CROWBAR_THAUMIUM.item();
if (item != null) {
String researchTag = "RC_Crowbar_Thaumium";
IArcaneRecipe recipe = ThaumcraftApi.addArcaneCraftingRecipe(researchTag, new ItemStack(item), new AspectList().add(Aspect.ORDER, 8), " RI", "RIR", "IR ", 'I', ThaumcraftPlugin.ITEMS.get("ingots", 0), 'R', "dyeRed");
AspectList aspects = new AspectList();
aspects.add(Aspect.TOOL, 1).add(Aspect.MECHANISM, 2).add(Aspect.METAL, 1);
ResearchItem thaumiumCrowbar = new ResearchItemRC(researchTag, ThaumcraftPlugin.RESEARCH_CATEGORY, aspects, 0, 0, 3, new ItemStack(item));
thaumiumCrowbar.setPages(ThaumcraftPlugin.getResearchPage(researchTag), new ResearchPage(recipe)).setParentsHidden("THAUMIUM").registerResearchItem();
}
// Void Crowbar
item = RailcraftItems.CROWBAR_VOID.item();
if (item != null) {
String researchTag = "RC_Crowbar_Void";
IArcaneRecipe recipe = ThaumcraftApi.addArcaneCraftingRecipe(researchTag, new ItemStack(item), new AspectList().add(Aspect.ENTROPY, 50), " RI", "RIR", "IR ", 'I', ThaumcraftPlugin.ITEMS.get("ingots", 1), 'R', "dyeRed");
AspectList aspects = new AspectList();
aspects.add(Aspect.TOOL, 2).add(Aspect.MECHANISM, 4).add(Aspect.METAL, 2);
ResearchItemRC voidCrowbar = new ResearchItemRC(researchTag, ThaumcraftPlugin.RESEARCH_CATEGORY, aspects, 0, 1, 3, new ItemStack(item));
voidCrowbar.setPages(ThaumcraftPlugin.getResearchPage(researchTag), new ResearchPage(recipe)).setParents(researchTag).setParentsHidden("VOIDMETAL").registerResearchItem();
}
}
use of net.minecraft.util.ResourceLocation in project Railcraft by Railcraft.
the class BlockItemListParser method parseBlock.
public static BlockKey parseBlock(String line) {
String[] tokens = line.split("#");
Block block = ForgeRegistries.BLOCKS.getValue(new ResourceLocation(tokens[0]));
if (block == null)
throw new IllegalArgumentException("Invalid Block Name while parsing config = " + line);
int meta = tokens.length > 1 ? Integer.valueOf(tokens[1]) : -1;
return new BlockKey(block.getStateFromMeta(meta));
}
Aggregations