add gradle

This commit is contained in:
Sen 2025-05-26 17:09:08 +02:00
parent bb6ebb0be8
commit 4e51e18bdc
Signed by: sen
GPG key ID: 3AC50A6F47D1B722
3033 changed files with 470 additions and 0 deletions

View file

@ -0,0 +1,103 @@
package common.block.artificial;
import java.util.List;
import common.block.Material;
import common.color.DyeColor;
import common.item.CheatTab;
import common.item.Item;
import common.item.ItemStack;
import common.model.BlockLayer;
import common.properties.IProperty;
import common.properties.PropertyEnum;
import common.world.State;
public class BlockStainedGlassPane extends BlockPane
{
public static final PropertyEnum<DyeColor> COLOR = PropertyEnum.<DyeColor>create("color", DyeColor.class);
public BlockStainedGlassPane()
{
super(Material.TRANSLUCENT, false);
this.setDefaultState(this.getBaseState().withProperty(NORTH, Boolean.valueOf(false)).withProperty(EAST, Boolean.valueOf(false)).withProperty(SOUTH, Boolean.valueOf(false)).withProperty(WEST, Boolean.valueOf(false)).withProperty(COLOR, DyeColor.WHITE));
this.setTab(CheatTab.BLOCKS);
}
/**
* Gets the metadata of the item this Block can drop. This method is called when the block gets destroyed. It
* returns the metadata of the dropped item based on the old metadata of the block.
*/
public int damageDropped(State state)
{
return ((DyeColor)state.getValue(COLOR)).getMetadata();
}
/**
* returns a list of blocks with the same ID, but different meta (eg: wood returns 4 blocks)
*/
public void getSubBlocks(Item itemIn, CheatTab tab, List<ItemStack> list)
{
for (int i = 0; i < DyeColor.values().length; ++i)
{
list.add(new ItemStack(itemIn, 1, i));
}
}
// /**
// * Get the MapColor for this Block and the given BlockState
// */
// public MapColor getMapColor(IBlockState state)
// {
// return ((EnumDyeColor)state.getValue(COLOR)).getMapColor();
// }
public BlockLayer getBlockLayer()
{
return BlockLayer.TRANSLUCENT;
}
/**
* Convert the given metadata into a BlockState for this Block
*/
public State getStateFromMeta(int meta)
{
return this.getState().withProperty(COLOR, DyeColor.byMetadata(meta));
}
/**
* Convert the BlockState into the correct metadata value
*/
public int getMetaFromState(State state)
{
return ((DyeColor)state.getValue(COLOR)).getMetadata();
}
protected IProperty[] getProperties()
{
return new IProperty[] {NORTH, EAST, WEST, SOUTH, COLOR};
}
// public void onBlockAdded(IWorldServer worldIn, BlockPos pos, State state)
// {
// if (!worldIn.client)
// {
// BlockBeacon.updateColorAsync(worldIn, pos);
// }
// }
//
// public void onBlockRemoved(IWorldServer worldIn, BlockPos pos, State state)
// {
// if (!worldIn.client)
// {
// BlockBeacon.updateColorAsync(worldIn, pos);
// }
// }
protected String getPaneBase(State state) {
return state.getValue(COLOR).getName() + "_glass";
}
protected String getPaneEdge(State state) {
return state.getValue(COLOR).getName() + "_glass_pane";
}
}