Removed old renamer
This commit is contained in:
@@ -21,16 +21,17 @@ package appeng.core.features;
|
||||
|
||||
import java.util.EnumSet;
|
||||
|
||||
import com.google.common.base.Optional;
|
||||
|
||||
import net.minecraftforge.fml.common.registry.GameData;
|
||||
import net.minecraftforge.fml.common.registry.GameRegistry;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
|
||||
import appeng.api.definitions.IBlockDefinition;
|
||||
import appeng.block.AEBaseBlock;
|
||||
import appeng.core.CommonHelper;
|
||||
import appeng.core.CreativeTab;
|
||||
|
||||
import com.google.common.base.Optional;
|
||||
|
||||
|
||||
public final class AEBlockFeatureHandler implements IFeatureHandler
|
||||
{
|
||||
@@ -69,16 +70,14 @@ public final class AEBlockFeatureHandler implements IFeatureHandler
|
||||
String name = this.extractor.get();
|
||||
this.featured.setCreativeTab( CreativeTab.instance );
|
||||
this.featured.setUnlocalizedName( /* "tile." */"appliedenergistics2." + name );
|
||||
this.featured.setBlockTextureName( name );
|
||||
|
||||
final String registryName = "tile." + name;
|
||||
this.featured.setBlockTextureName( name );
|
||||
|
||||
// Bypass the forge magic with null to register our own itemblock later.
|
||||
GameRegistry.registerBlock( this.featured, null, registryName );
|
||||
GameRegistry.registerItem( this.definition.maybeItem().get(), registryName );
|
||||
GameRegistry.registerBlock( this.featured, null, name );
|
||||
GameRegistry.registerItem( this.definition.maybeItem().get(), name );
|
||||
|
||||
// register the block/item conversion...
|
||||
if ( this.featured != null && this.definition.maybeItem().isPresent() )
|
||||
if ( this.definition.maybeItem().isPresent() )
|
||||
GameData.getBlockItemMap().put( this.featured, this.definition.maybeItem().get() );
|
||||
|
||||
if ( side == Side.CLIENT)
|
||||
|
||||
@@ -55,6 +55,10 @@ public class FeatureNameExtractor
|
||||
{
|
||||
name = "stair";
|
||||
}
|
||||
else if ( name.startsWith( "BlockFluix" ) )
|
||||
{
|
||||
name = "fluix";
|
||||
}
|
||||
|
||||
if( this.subName.isPresent() )
|
||||
{
|
||||
|
||||
@@ -21,17 +21,18 @@ package appeng.core.features;
|
||||
|
||||
import java.util.EnumSet;
|
||||
|
||||
import com.google.common.base.Optional;
|
||||
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraftforge.fml.common.registry.GameRegistry;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
|
||||
import appeng.api.definitions.IItemDefinition;
|
||||
import appeng.core.CommonHelper;
|
||||
import appeng.core.CreativeTab;
|
||||
import appeng.core.CreativeTabFacade;
|
||||
import appeng.items.parts.ItemFacade;
|
||||
|
||||
import com.google.common.base.Optional;
|
||||
|
||||
|
||||
public final class ItemFeatureHandler implements IFeatureHandler
|
||||
{
|
||||
@@ -63,13 +64,13 @@ public final class ItemFeatureHandler implements IFeatureHandler
|
||||
}
|
||||
|
||||
@Override
|
||||
public void register(Side side)
|
||||
public void register( Side side )
|
||||
{
|
||||
if( this.enabled )
|
||||
{
|
||||
String name = this.extractor.get();
|
||||
String itemPhysicalName = name;
|
||||
|
||||
|
||||
//this.item.setTextureName( "appliedenergistics2:" + name );
|
||||
this.item.setUnlocalizedName( /* "item." */"appliedenergistics2." + name );
|
||||
|
||||
@@ -91,21 +92,17 @@ public final class ItemFeatureHandler implements IFeatureHandler
|
||||
name = "ItemMultiPart";
|
||||
}
|
||||
|
||||
GameRegistry.registerItem( this.item, "item." + name );
|
||||
|
||||
if ( side == Side.CLIENT )
|
||||
// "item." +
|
||||
GameRegistry.registerItem( this.item, name );
|
||||
|
||||
if( side == Side.CLIENT )
|
||||
{
|
||||
CommonHelper.proxy.configureIcon( item, itemPhysicalName );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void configureIcon(
|
||||
Item item,
|
||||
int meta,
|
||||
String name )
|
||||
private void configureIcon( Item item, int meta, String name )
|
||||
{
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,85 +0,0 @@
|
||||
/*
|
||||
* This file is part of Applied Energistics 2.
|
||||
* Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved.
|
||||
*
|
||||
* Applied Energistics 2 is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Applied Energistics 2 is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Applied Energistics 2. If not, see <http://www.gnu.org/licenses/lgpl>.
|
||||
*/
|
||||
|
||||
package appeng.core.features;
|
||||
|
||||
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import appeng.items.AEBaseItem;
|
||||
|
||||
|
||||
/**
|
||||
* This class is used to rename items to match the persistent stored items.
|
||||
*
|
||||
* This can be removed, when a new iteration of minecraft arrives or a new world is used.
|
||||
* Remember to differentiate the currently renamed items later on correctly.
|
||||
*
|
||||
* @deprecated only a temporary solution for a rename
|
||||
*/
|
||||
@Deprecated
|
||||
public final class NameResolver
|
||||
{
|
||||
private static final Pattern ITEM_MULTI_PART = Pattern.compile( "ItemMultiPart", Pattern.LITERAL );
|
||||
private static final Pattern ITEM_MULTI_MATERIAL = Pattern.compile( "ItemMultiMaterial", Pattern.LITERAL );
|
||||
private static final Pattern QUARTZ = Pattern.compile( "Quartz", Pattern.LITERAL );
|
||||
|
||||
private final Class<? extends AEBaseItem> withOriginalName;
|
||||
|
||||
public NameResolver( Class<? extends AEBaseItem> withOriginalName )
|
||||
{
|
||||
this.withOriginalName = withOriginalName;
|
||||
}
|
||||
|
||||
public String getName( String subName )
|
||||
{
|
||||
String name = this.withOriginalName.getSimpleName();
|
||||
|
||||
if( name.startsWith( "ItemMultiPart" ) )
|
||||
{
|
||||
name = ITEM_MULTI_PART.matcher( name ).replaceAll( "ItemPart" );
|
||||
}
|
||||
else if( name.startsWith( "ItemMultiMaterial" ) )
|
||||
{
|
||||
name = ITEM_MULTI_MATERIAL.matcher( name ).replaceAll( "ItemMaterial" );
|
||||
}
|
||||
|
||||
if( subName != null )
|
||||
{
|
||||
// simple hack to allow me to do get nice names for these without
|
||||
// mode code outside of AEBaseItem
|
||||
if( subName.startsWith( "P2PTunnel" ) )
|
||||
{
|
||||
return "ItemPart.P2PTunnel";
|
||||
}
|
||||
|
||||
if( subName.equals( "CertusQuartzTools" ) )
|
||||
{
|
||||
return QUARTZ.matcher( name ).replaceAll( "CertusQuartz" );
|
||||
}
|
||||
if( subName.equals( "NetherQuartzTools" ) )
|
||||
{
|
||||
return QUARTZ.matcher( name ).replaceAll( "NetherQuartz" );
|
||||
}
|
||||
|
||||
name += '.' + subName;
|
||||
}
|
||||
|
||||
return name;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user