Java Code Examples for net.minecraftforge.fml.relauncher.ReflectionHelper#findField()

The following examples show how to use net.minecraftforge.fml.relauncher.ReflectionHelper#findField() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ItemHelper.java    From customstuff4 with GNU General Public License v3.0 6 votes vote down vote up
private static String getTabLabel(CreativeTabs tab)
{
    if (tabLabelField == null)
    {
        tabLabelField = ReflectionHelper.findField(CreativeTabs.class, "tabLabel", "field_78034_o", "o");
        tabLabelField.setAccessible(true);
    }

    try
    {
        return (String) tabLabelField.get(tab);
    } catch (IllegalAccessException e)
    {
        e.printStackTrace();
    }

    return null;
}
 
Example 2
Source File: ChunkManagerPlanet.java    From AdvancedRocketry with MIT License 6 votes vote down vote up
public ChunkManagerPlanet(long seed, WorldType default1, String str, DimensionProperties properties) {

		this.biomeCache = new BiomeCache(this);//new BiomeCacheExtended(this);
		//TODO: more biomes
		//TODO: remove rivers
		GenLayer[] agenlayer = initializeAllBiomeGenerators(seed, default1, str, properties);//GenLayer.initializeAllBiomeGenerators(seed, default1); //;
		agenlayer = getModdedBiomeGenerators(default1, seed, agenlayer);
		this.genBiomes = agenlayer[0];
		this.biomeIndexLayer = agenlayer[1];

		ReflectionHelper.setPrivateValue(BiomeProvider.class, this, this.genBiomes, "genBiomes", "field_76944_d");
		ReflectionHelper.setPrivateValue(BiomeProvider.class, this, this.biomeIndexLayer, "biomeIndexLayer", "field_76945_e");
		
		fBiomeCache = ReflectionHelper.findField(BiomeCache.class, "cache", "field_76841_d");
		fBiomeCache.setAccessible(true);

		fBiomeCacheMap = ReflectionHelper.findField(BiomeCache.class, "cacheMap", "field_76843_c");
		fBiomeCacheMap.setAccessible(true);
	}
 
Example 3
Source File: ItemUpgrade.java    From AdvancedRocketry with MIT License 5 votes vote down vote up
public ItemUpgrade(int num) {
	super(num);
	setMaxStackSize(1);
	
	walkSpeed = ReflectionHelper.findField(net.minecraft.entity.player.PlayerCapabilities.class, "walkSpeed", "field_75097_g");
	walkSpeed.setAccessible(true);
}
 
Example 4
Source File: EntityConcussionCreeper.java    From EnderZoo with Creative Commons Zero v1.0 Universal 5 votes vote down vote up
public EntityConcussionCreeper(World world) {
  super(world);
  try {
    fTimeSinceIgnited = ReflectionHelper.findField(EntityCreeper.class, "timeSinceIgnited", "field_70833_d");
    fFuseTime = ReflectionHelper.findField(EntityCreeper.class, "fuseTime", "field_82225_f");
  } catch (Exception e) {
    Log.error("Could not create ender creeper  logic as fields not found");
  }
}
 
Example 5
Source File: ItemJetpack.java    From AdvancedRocketry with MIT License 4 votes vote down vote up
public ItemJetpack() {
	flySpeed = ReflectionHelper.findField(net.minecraft.entity.player.PlayerCapabilities.class, "flySpeed", "field_75096_f");
	flySpeed.setAccessible(true);
}