use of icbm.classic.api.EnumTier in project ICBM-Classic by BuiltBrokenModding.
the class BlockLaunchScreen method getActualState.
@Override
public IBlockState getActualState(IBlockState state, IBlockAccess worldIn, BlockPos pos) {
EnumTier tier = EnumTier.ONE;
TileEntity tile = worldIn.getTileEntity(pos);
if (tile instanceof TileLauncherScreen) {
tier = ((TileLauncherScreen) tile)._tier;
}
return state.withProperty(TIER_PROP, tier);
}
use of icbm.classic.api.EnumTier in project ICBM-Classic by BuiltBrokenModding.
the class BlockLauncherBase method getActualState.
@Override
public IBlockState getActualState(IBlockState state, IBlockAccess worldIn, BlockPos pos) {
EnumTier tier = EnumTier.ONE;
TileEntity tile = worldIn.getTileEntity(pos);
if (tile instanceof TileLauncherBase) {
tier = ((TileLauncherBase) tile)._tier;
}
return state.withProperty(TIER_PROP, tier);
}
use of icbm.classic.api.EnumTier in project ICBM-Classic by BuiltBrokenModding.
the class ItemBlockExplosive method getDetailedInfo.
@Override
public void getDetailedInfo(ItemStack stack, @Nullable EntityPlayer player, List list) {
final IExplosiveData data = ICBMClassicHelpers.getExplosive(stack.getItemDamage(), true);
if (data != null) {
final EnumTier tierdata = data.getTier();
list.add(TextFormatting.DARK_RED + LanguageUtility.getLocal("info.misc.tier") + ": " + tierdata.getTooltipColor() + tierdata.getLocalizedName());
}
if (// TODO add hook for any explosive via content reg
stack.getItemDamage() == ICBMExplosives.REDMATTER.getRegistryID()) {
// /Shhh!!! tell no one this exists, tis a surprise
boolean taunt = shouldTauntPlayer(player);
if (taunt) {
switch(tauntCount) {
case 0:
list.add("Place me, you know you want to :)");
// $FALL-THROUGH$
case 1:
list.add("Mine with me, lets get some minerals!!");
// $FALL-THROUGH$
case 2:
list.add("Can you hear the noises in the dark?");
// $FALL-THROUGH$
case 3:
list.add("One does not simply use");
list.add("redmatter to cancel redmatter");
// $FALL-THROUGH$
case 4:
list.add("Nice base you have");
list.add("be a shame if something");
list.add("would happen to it");
// $FALL-THROUGH$
case 5:
list.add("Don't worry i've changed");
// $FALL-THROUGH$
case 6:
list.add("Lets eat a world together");
// $FALL-THROUGH$
case 7:
list.add("I'm back for you");
}
} else {
normalDetailedInfo(list);
}
// Cycle next message
if (player != null && System.currentTimeMillis() - lastTranslationChange > changeOverDelay) {
lastTranslationChange = System.currentTimeMillis();
if (taunt) {
tauntCount = player.world.rand.nextInt(7);
} else if (redmatterRandomTranslations > 0) {
tauntCount = player.world.rand.nextInt(redmatterRandomTranslations);
}
}
} else {
super.getDetailedInfo(stack, player, list);
}
}
use of icbm.classic.api.EnumTier in project ICBM-Classic by BuiltBrokenModding.
the class BlockLaunchFrame method getActualState.
@Override
public IBlockState getActualState(IBlockState state, IBlockAccess worldIn, BlockPos pos) {
EnumTier tier = EnumTier.ONE;
TileEntity tile = worldIn.getTileEntity(pos);
if (tile instanceof TileLauncherFrame) {
tier = ((TileLauncherFrame) tile)._tier;
}
return state.withProperty(TIER_PROP, tier);
}
use of icbm.classic.api.EnumTier in project ICBM-Classic by BuiltBrokenModding.
the class ClientReg method registerLauncherPart.
protected static void registerLauncherPart(Block block) {
final String resourcePath = block.getRegistryName().toString();
ModelLoader.setCustomStateMapper(block, new DefaultStateMapper() {
@Override
protected ModelResourceLocation getModelResourceLocation(IBlockState state) {
return new ModelResourceLocation(resourcePath, getPropertyString(state.getProperties()));
}
});
for (EnumTier tier : new EnumTier[] { EnumTier.ONE, EnumTier.TWO, EnumTier.THREE }) {
IBlockState state = block.getDefaultState().withProperty(BlockICBM.TIER_PROP, tier).withProperty(BlockICBM.ROTATION_PROP, EnumFacing.UP);
String properties_string = getPropertyString(state.getProperties());
ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(block), tier.ordinal(), new ModelResourceLocation(resourcePath, properties_string));
}
}
Aggregations