use of net.minecraft.util.ResourceLocation in project ImmersiveEngineering by BluSunrize.
the class ShaderRegistry method registerShader_Revolver.
/**
* Method to register a default implementation of Chemthrower Shaders<br>
* @param name name of the shader
* @param overlayType uses IE's existing overlays. To use custom ones, you'll need your own method.
* @param rarity Rarity of the shader item
* @param colour0 grip colour
* @param colour1 base colour
* @param colour2 design colour
* @param colourBlade colour of the bayonet blade
* @param additionalTexture additional overlay texture. Null if not needed.
* @param colourAddtional colour for the additional texture, if present
* @return the registered ShaderCase
*/
public static ShaderCaseRevolver registerShader_Revolver(String name, String overlayType, EnumRarity rarity, int colour0, int colour1, int colour2, int colourBlade, String additionalTexture, int colourAddtional) {
ArrayList<ShaderLayer> list = new ArrayList();
list.add(new ShaderLayer(new ResourceLocation("immersiveengineering:revolvers/shaders/revolver_grip"), colour0));
list.add(new ShaderLayer(new ResourceLocation("immersiveengineering:revolvers/shaders/revolver_0"), colour1));
list.add(new ShaderLayer(new ResourceLocation("immersiveengineering:revolvers/shaders/revolver_0"), colourBlade));
list.add(new ShaderLayer(new ResourceLocation("immersiveengineering:revolvers/shaders/revolver_1_" + overlayType), colour2));
if (additionalTexture != null) {
ResourceLocation rl = new ResourceLocation("immersiveengineering:revolvers/shaders/revolver_" + additionalTexture);
list.add(new ShaderLayer(rl, colourAddtional).setTextureBounds(defaultLayerBounds.get(rl)));
}
list.add(new ShaderLayer(new ResourceLocation("immersiveengineering:revolvers/shaders/revolver_uncoloured"), 0xffffffff));
ShaderCaseRevolver shader = new ShaderCaseRevolver(list);
return registerShaderCase(name, shader, rarity);
}
use of net.minecraft.util.ResourceLocation in project NetherEx by LogicTechCorp.
the class RemapHandler method remapRegistryName.
private static boolean remapRegistryName(FMLMissingMappingsEvent.MissingMapping mapping) {
String missingPath = mapping.resourceLocation.getResourcePath();
if (!customNames.containsKey(missingPath)) {
return false;
}
String newPath = customNames.get(missingPath);
ResourceLocation registryName = new ResourceLocation(mapping.resourceLocation.getResourceDomain() + newPath);
return attemptRemap(mapping, registryName);
}
use of net.minecraft.util.ResourceLocation in project RFToolsDimensions by McJty.
the class KnownDimletConfiguration method initMaterialDimlet.
private static void initMaterialDimlet(Block block) {
if (block instanceof BlockLiquid) {
return;
}
Set<Filter.Feature> features = getBlockFeatures(block);
ResourceLocation nameForObject = Block.REGISTRY.getNameForObject(block);
String mod = nameForObject.getResourceDomain();
for (IBlockState state : block.getBlockState().getValidStates()) {
int meta = state.getBlock().getMetaFromState(state);
ItemStack stack = new ItemStack(state.getBlock(), 1, state.getBlock().getMetaFromState(state));
if (stack.getItem() != null) {
// Protection
List<IProperty<?>> propertyNames = new ArrayList<>(CompatBlock.getPropertyKeys(state));
propertyNames.sort((o1, o2) -> o1.getName().compareTo(o2.getName()));
ImmutableMap<IProperty<?>, Comparable<?>> properties = state.getProperties();
Map<String, String> props = new HashMap<>();
for (Map.Entry<IProperty<?>, Comparable<?>> entry : properties.entrySet()) {
props.put(entry.getKey().getName(), entry.getValue().toString());
}
DimletKey key = new DimletKey(DimletType.DIMLET_MATERIAL, block.getRegistryName() + "@" + meta);
Settings settings = DimletRules.getSettings(key, mod, features, props);
if (!settings.isBlacklisted()) {
knownDimlets.put(key, settings);
}
}
}
}
use of net.minecraft.util.ResourceLocation in project RFToolsDimensions by McJty.
the class DimletObjectMapping method getFluid.
public static Block getFluid(DimletKey dimlet) {
if (DimletType.DIMLET_LIQUID.equals(dimlet.getType())) {
String id = dimlet.getId();
// @todo temporary for people who accidently got an old Default dimlet
if (DimletObjectMapping.DEFAULT_ID.equals(id)) {
return Blocks.WATER;
}
int lastIndexOf = StringUtils.lastIndexOf(id, "@");
String blockid;
if (lastIndexOf == -1) {
blockid = id;
} else {
blockid = id.substring(0, lastIndexOf);
}
// int meta = Integer.parseInt(id.substring(lastIndexOf+1));
Block block = Block.REGISTRY.getObject(new ResourceLocation(blockid));
if (block == null) {
return null;
}
return block;
}
return null;
}
use of net.minecraft.util.ResourceLocation in project RFToolsDimensions by McJty.
the class KnownDimletConfiguration method initFluidDimlet.
private static void initFluidDimlet(Map.Entry<String, Fluid> me) {
if (me.getValue().canBePlacedInWorld()) {
String name = me.getKey();
if (name != null && !name.isEmpty()) {
Block block = me.getValue().getBlock();
if (block != null) {
ResourceLocation nameForObject = Block.REGISTRY.getNameForObject(block);
if (nameForObject != null) {
String mod = nameForObject.getResourceDomain();
DimletKey key = new DimletKey(DimletType.DIMLET_LIQUID, block.getRegistryName() + "@0");
initDimlet(key, mod);
}
}
}
}
}
Aggregations