Added bloc manager
@ -1,5 +1,13 @@
|
|||||||
package fr.jackcartersmith.orbsat;
|
package fr.jackcartersmith.orbsat;
|
||||||
|
|
||||||
public class OSBlocks {
|
import fr.jackcartersmith.orbsat.block.BlockOSBase;
|
||||||
|
import net.minecraft.block.material.Material;
|
||||||
|
import net.minecraft.block.properties.PropertyEnum;
|
||||||
|
|
||||||
|
public class OSBlocks {
|
||||||
|
public static BlockOSBase satelliteLauncher;
|
||||||
|
|
||||||
|
public static void init(){
|
||||||
|
satelliteLauncher = new Block;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
37
src/main/java/fr/jackcartersmith/orbsat/OSEnums.java
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
package fr.jackcartersmith.orbsat;
|
||||||
|
|
||||||
|
import java.util.Locale;
|
||||||
|
|
||||||
|
import net.minecraft.util.IStringSerializable;
|
||||||
|
|
||||||
|
public class OSEnums {
|
||||||
|
public enum SideConfig implements IStringSerializable
|
||||||
|
{
|
||||||
|
NONE("none"),
|
||||||
|
INPUT("in"),
|
||||||
|
OUTPUT("out");
|
||||||
|
|
||||||
|
final String texture;
|
||||||
|
|
||||||
|
SideConfig(String texture)
|
||||||
|
{
|
||||||
|
this.texture = texture;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getName()
|
||||||
|
{
|
||||||
|
return this.toString().toLowerCase(Locale.ENGLISH);
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTextureName()
|
||||||
|
{
|
||||||
|
return texture;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static SideConfig next(SideConfig current)
|
||||||
|
{
|
||||||
|
return current==INPUT?OUTPUT: current==OUTPUT?NONE: INPUT;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -7,8 +7,9 @@ public class OSItems {
|
|||||||
public static ItemOSBase satelliteItem;
|
public static ItemOSBase satelliteItem;
|
||||||
|
|
||||||
public static void init(){
|
public static void init(){
|
||||||
componentsItem = new ItemOSBase("components",1,
|
componentsItem = new ItemOSBase("components",3,
|
||||||
"laserDesignator","designatorCircuit");
|
"laserDesignator","designatorCircuit",
|
||||||
|
"photonLens","photonConcentrator","photonCapacitor");
|
||||||
satelliteItem = new ItemOSBase("satellites",1,
|
satelliteItem = new ItemOSBase("satellites",1,
|
||||||
"classic_mki","classic_mkii","classic_mkiii");
|
"classic_mki","classic_mkii","classic_mkiii");
|
||||||
}
|
}
|
||||||
|
201
src/main/java/fr/jackcartersmith/orbsat/OSProperties.java
Normal file
@ -0,0 +1,201 @@
|
|||||||
|
package fr.jackcartersmith.orbsat;
|
||||||
|
|
||||||
|
import java.util.Collection;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
|
import com.google.common.base.Optional;
|
||||||
|
import com.google.common.collect.ImmutableSet;
|
||||||
|
|
||||||
|
import fr.jackcartersmith.orbsat.OSEnums.SideConfig;
|
||||||
|
import net.minecraft.block.properties.PropertyDirection;
|
||||||
|
import net.minecraft.block.properties.PropertyHelper;
|
||||||
|
import net.minecraft.block.properties.PropertyInteger;
|
||||||
|
import net.minecraft.tileentity.TileEntity;
|
||||||
|
import net.minecraft.util.EnumFacing;
|
||||||
|
import net.minecraftforge.common.property.IUnlistedProperty;
|
||||||
|
|
||||||
|
public class OSProperties {
|
||||||
|
public static final PropertyDirection FACING_ALL = PropertyDirection.create("facing");
|
||||||
|
public static final PropertyDirection FACING_HORIZONTAL = PropertyDirection.create("facing", EnumFacing.Plane.HORIZONTAL);
|
||||||
|
|
||||||
|
public static final PropertyBoolInverted MULTIBLOCKSLAVE = PropertyBoolInverted.create("_0multiblockslave");//Name starts with '_0' to ensure priority when overriding models
|
||||||
|
public static final PropertyBoolInverted DYNAMICRENDER = PropertyBoolInverted.create("_1dynamicrender");//Name starts with '_1' to ensure priority over anything but the multiblockslave property
|
||||||
|
public static final PropertySet CONNECTIONS = new PropertySet("conns");
|
||||||
|
|
||||||
|
// public static final PropertyEnum[] SIDECONFIG = {
|
||||||
|
// PropertyEnum.create("sideconfig_down", IEEnums.SideConfig.class),
|
||||||
|
// PropertyEnum.create("sideconfig_up", IEEnums.SideConfig.class),
|
||||||
|
// PropertyEnum.create("sideconfig_north", IEEnums.SideConfig.class),
|
||||||
|
// PropertyEnum.create("sideconfig_south", IEEnums.SideConfig.class),
|
||||||
|
// PropertyEnum.create("sideconfig_west", IEEnums.SideConfig.class),
|
||||||
|
// PropertyEnum.create("sideconfig_east", IEEnums.SideConfig.class)
|
||||||
|
// };
|
||||||
|
public static final ProperySideConfig[] SIDECONFIG = {
|
||||||
|
new ProperySideConfig("sideconfig_down"),
|
||||||
|
new ProperySideConfig("sideconfig_up"),
|
||||||
|
new ProperySideConfig("sideconfig_north"),
|
||||||
|
new ProperySideConfig("sideconfig_south"),
|
||||||
|
new ProperySideConfig("sideconfig_west"),
|
||||||
|
new ProperySideConfig("sideconfig_east")
|
||||||
|
};
|
||||||
|
public static final PropertyBoolInverted[] SIDECONNECTION = {
|
||||||
|
PropertyBoolInverted.create("sideconnection_down"),
|
||||||
|
PropertyBoolInverted.create("sideconnection_up"),
|
||||||
|
PropertyBoolInverted.create("sideconnection_north"),
|
||||||
|
PropertyBoolInverted.create("sideconnection_south"),
|
||||||
|
PropertyBoolInverted.create("sideconnection_west"),
|
||||||
|
PropertyBoolInverted.create("sideconnection_east")
|
||||||
|
};
|
||||||
|
|
||||||
|
//An array of non-descript booleans for mirroring, active textures, etc.
|
||||||
|
public static final PropertyBoolInverted[] BOOLEANS = {
|
||||||
|
PropertyBoolInverted.create("boolean0"),
|
||||||
|
PropertyBoolInverted.create("boolean1"),
|
||||||
|
PropertyBoolInverted.create("boolean2")
|
||||||
|
};
|
||||||
|
public static final PropertyInteger INT_4 = PropertyInteger.create("int_4", 0,3);
|
||||||
|
public static final PropertyInteger INT_16 = PropertyInteger.create("int_16", 0,15);
|
||||||
|
|
||||||
|
public static class ProperySideConfig implements IUnlistedProperty<SideConfig>
|
||||||
|
{
|
||||||
|
final String name;
|
||||||
|
public ProperySideConfig(String name)
|
||||||
|
{
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public String getName()
|
||||||
|
{
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public boolean isValid(SideConfig value)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public Class<SideConfig> getType()
|
||||||
|
{
|
||||||
|
return OSEnums.SideConfig.class;
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public String valueToString(SideConfig value)
|
||||||
|
{
|
||||||
|
return value.toString();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static final IUnlistedProperty<HashMap> OBJ_TEXTURE_REMAP = new IUnlistedProperty<HashMap>()
|
||||||
|
{
|
||||||
|
@Override
|
||||||
|
public String getName()
|
||||||
|
{
|
||||||
|
return "obj_texture_remap";
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public boolean isValid(HashMap value)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public Class<HashMap> getType() {
|
||||||
|
return HashMap.class;
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public String valueToString(HashMap value)
|
||||||
|
{
|
||||||
|
return value.toString();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
public static class PropertyBoolInverted extends PropertyHelper<Boolean>
|
||||||
|
{
|
||||||
|
private final ImmutableSet<Boolean> allowedValues = ImmutableSet.of(Boolean.valueOf(false), Boolean.valueOf(true));
|
||||||
|
protected PropertyBoolInverted(String name)
|
||||||
|
{
|
||||||
|
super(name, Boolean.class);
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public Collection<Boolean> getAllowedValues()
|
||||||
|
{
|
||||||
|
return this.allowedValues;
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public Optional<Boolean> parseValue(String value)
|
||||||
|
{
|
||||||
|
return Optional.of(Boolean.getBoolean(value));
|
||||||
|
}
|
||||||
|
public static PropertyBoolInverted create(String name)
|
||||||
|
{
|
||||||
|
return new PropertyBoolInverted(name);
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public String getName(Boolean value)
|
||||||
|
{
|
||||||
|
return value.toString();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("rawtypes")
|
||||||
|
public static class PropertySet implements IUnlistedProperty<Set>
|
||||||
|
{
|
||||||
|
String name;
|
||||||
|
|
||||||
|
public PropertySet(String n)
|
||||||
|
{
|
||||||
|
name = n;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getName()
|
||||||
|
{
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isValid(Set value)
|
||||||
|
{
|
||||||
|
return value != null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Class<Set> getType()
|
||||||
|
{
|
||||||
|
return Set.class;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String valueToString(Set value)
|
||||||
|
{
|
||||||
|
return value.toString();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static final IUnlistedProperty<TileEntity> TILEENTITY_PASSTHROUGH = new IUnlistedProperty<TileEntity>()
|
||||||
|
{
|
||||||
|
@Override
|
||||||
|
public String getName()
|
||||||
|
{
|
||||||
|
return "tileentity_passthrough";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isValid(TileEntity value)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Class<TileEntity> getType()
|
||||||
|
{
|
||||||
|
return TileEntity.class;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String valueToString(TileEntity value)
|
||||||
|
{
|
||||||
|
return value.toString();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
@ -13,6 +13,18 @@ public class OSRefs {
|
|||||||
public static final String CLIENT_PROXY_CLASS = "fr.jackcartersmith.orbsat.client.ClientProxy";
|
public static final String CLIENT_PROXY_CLASS = "fr.jackcartersmith.orbsat.client.ClientProxy";
|
||||||
public static final String COMMON_PROXY_CLASS = "fr.jackcartersmith.orbsat.common.CommonProxy";
|
public static final String COMMON_PROXY_CLASS = "fr.jackcartersmith.orbsat.common.CommonProxy";
|
||||||
|
|
||||||
|
public static final String CHAT = "chat." + MODID + ".";
|
||||||
|
public static final String CHAT_WARN = CHAT+"warning.";
|
||||||
|
public static final String CHAT_INFO = CHAT+"info.";
|
||||||
|
public static final String CHAT_COMMAND = CHAT+"command.";
|
||||||
|
|
||||||
|
public static final String DESC = "desc." + MODID + ".";
|
||||||
|
public static final String DESC_INFO = DESC+"info.";
|
||||||
|
public static final String DESC_FLAVOUR = DESC+"flavour.";
|
||||||
|
|
||||||
|
public static final String GUI = "gui." + MODID + ".";
|
||||||
|
public static final String GUI_CONFIG = "gui." + MODID + ".config.";
|
||||||
|
|
||||||
public static ArrayList<Item> registeredOSItems = new ArrayList<Item>();
|
public static ArrayList<Item> registeredOSItems = new ArrayList<Item>();
|
||||||
public static ArrayList<Block> registeredOSBlocks = new ArrayList<Block>();
|
public static ArrayList<Block> registeredOSBlocks = new ArrayList<Block>();
|
||||||
}
|
}
|
||||||
|
@ -34,6 +34,7 @@ public class OrbitalSatellite {
|
|||||||
{
|
{
|
||||||
OSLogger.info("[OrbSAT] Connection of primary laser chamber...");
|
OSLogger.info("[OrbSAT] Connection of primary laser chamber...");
|
||||||
OSItems.init();
|
OSItems.init();
|
||||||
|
OSBlocks.init();
|
||||||
proxy.preInit();
|
proxy.preInit();
|
||||||
}
|
}
|
||||||
@Mod.EventHandler
|
@Mod.EventHandler
|
||||||
@ -112,7 +113,7 @@ public class OrbitalSatellite {
|
|||||||
@Override
|
@Override
|
||||||
public ItemStack getIconItemStack()
|
public ItemStack getIconItemStack()
|
||||||
{
|
{
|
||||||
return new ItemStack(OSItems.satelliteItem,1,0);
|
return new ItemStack(OSItems.componentsItem,1,1);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
536
src/main/java/fr/jackcartersmith/orbsat/block/BlockOSBase.java
Normal file
@ -0,0 +1,536 @@
|
|||||||
|
package fr.jackcartersmith.orbsat.block;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Locale;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
|
import com.google.common.collect.Sets;
|
||||||
|
|
||||||
|
import fr.jackcartersmith.orbsat.OSRefs;
|
||||||
|
import fr.jackcartersmith.orbsat.OrbitalSatellite;
|
||||||
|
import fr.jackcartersmith.orbsat.block.OSBlockInterface.IOSMetaBlock;
|
||||||
|
import net.minecraft.block.Block;
|
||||||
|
import net.minecraft.block.SoundType;
|
||||||
|
import net.minecraft.block.material.Material;
|
||||||
|
import net.minecraft.block.properties.IProperty;
|
||||||
|
import net.minecraft.block.properties.PropertyEnum;
|
||||||
|
import net.minecraft.block.state.BlockStateContainer;
|
||||||
|
import net.minecraft.block.state.IBlockState;
|
||||||
|
import net.minecraft.client.renderer.block.statemap.StateMapperBase;
|
||||||
|
import net.minecraft.creativetab.CreativeTabs;
|
||||||
|
import net.minecraft.entity.Entity;
|
||||||
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import net.minecraft.item.Item;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.util.BlockRenderLayer;
|
||||||
|
import net.minecraft.util.EnumFacing;
|
||||||
|
import net.minecraft.util.IStringSerializable;
|
||||||
|
import net.minecraft.util.math.BlockPos;
|
||||||
|
import net.minecraft.world.Explosion;
|
||||||
|
import net.minecraft.world.IBlockAccess;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
import net.minecraftforge.common.property.ExtendedBlockState;
|
||||||
|
import net.minecraftforge.common.property.IUnlistedProperty;
|
||||||
|
import net.minecraftforge.fml.relauncher.Side;
|
||||||
|
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
|
public class BlockOSBase<E extends Enum<E> & BlockOSBase.IBlockEnum> extends Block implements IOSMetaBlock{
|
||||||
|
protected static IProperty[] tempProperties;
|
||||||
|
protected static IUnlistedProperty[] tempUnlistedProperties;
|
||||||
|
|
||||||
|
public final String name;
|
||||||
|
public final PropertyEnum<E> property;
|
||||||
|
public final IProperty[] additionalProperties;
|
||||||
|
public final IUnlistedProperty[] additionalUnlistedProperties;
|
||||||
|
public final E[] enumValues;
|
||||||
|
boolean[] isMetaHidden;
|
||||||
|
boolean[] hasFlavour;
|
||||||
|
protected Set<BlockRenderLayer> renderLayers = Sets.newHashSet(BlockRenderLayer.SOLID);
|
||||||
|
protected Set<BlockRenderLayer>[] metaRenderLayers;
|
||||||
|
protected Map<Integer, Integer> metaLightOpacities = new HashMap<>();
|
||||||
|
protected Map<Integer, Integer> metaResistances = new HashMap<>();
|
||||||
|
protected boolean[] metaNotNormalBlock;
|
||||||
|
private boolean opaqueCube = false;
|
||||||
|
|
||||||
|
public BlockOSBase(String name, Material material, PropertyEnum<E> mainProperty, Class<? extends ItemBlockOSBase> itemBlock, Object... additionalProperties)
|
||||||
|
{
|
||||||
|
super(setTempProperties(material, mainProperty, additionalProperties));
|
||||||
|
this.name = name;
|
||||||
|
this.property = mainProperty;
|
||||||
|
this.enumValues = mainProperty.getValueClass().getEnumConstants();
|
||||||
|
this.isMetaHidden = new boolean[this.enumValues.length];
|
||||||
|
this.hasFlavour = new boolean[this.enumValues.length];
|
||||||
|
this.metaRenderLayers = new Set[this.enumValues.length];
|
||||||
|
|
||||||
|
ArrayList<IProperty> propList = new ArrayList<IProperty>();
|
||||||
|
ArrayList<IUnlistedProperty> unlistedPropList = new ArrayList<IUnlistedProperty>();
|
||||||
|
for(Object o : additionalProperties)
|
||||||
|
{
|
||||||
|
if(o instanceof IProperty)
|
||||||
|
propList.add((IProperty)o);
|
||||||
|
if(o instanceof IProperty[])
|
||||||
|
for(IProperty p : ((IProperty[])o))
|
||||||
|
propList.add(p);
|
||||||
|
if(o instanceof IUnlistedProperty)
|
||||||
|
unlistedPropList.add((IUnlistedProperty)o);
|
||||||
|
if(o instanceof IUnlistedProperty[])
|
||||||
|
for(IUnlistedProperty p : ((IUnlistedProperty[])o))
|
||||||
|
unlistedPropList.add(p);
|
||||||
|
}
|
||||||
|
this.additionalProperties = propList.toArray(new IProperty[propList.size()]);
|
||||||
|
this.additionalUnlistedProperties = unlistedPropList.toArray(new IUnlistedProperty[unlistedPropList.size()]);
|
||||||
|
this.setDefaultState(getInitDefaultState());
|
||||||
|
String registryName = createRegistryName();
|
||||||
|
this.setUnlocalizedName(registryName.replace(':', '.'));
|
||||||
|
this.setCreativeTab(OrbitalSatellite.creativeTab);
|
||||||
|
this.adjustSound();
|
||||||
|
OrbitalSatellite.registerBlockByFullName(this, itemBlock, registryName);
|
||||||
|
OSRefs.registeredOSBlocks.add(this);
|
||||||
|
lightOpacity = 255;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getOSBlockName()
|
||||||
|
{
|
||||||
|
return this.name;
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public Enum[] getMetaEnums()
|
||||||
|
{
|
||||||
|
return enumValues;
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public IBlockState getInventoryState(int meta)
|
||||||
|
{
|
||||||
|
IBlockState state = this.blockState.getBaseState().withProperty(this.property, enumValues[meta]);
|
||||||
|
// for(int i=0; i<this.additionalProperties.length; i++)
|
||||||
|
// if(this.additionalProperties[i]!=null && !this.additionalProperties[i].getAllowedValues().isEmpty())
|
||||||
|
// state = state.withProperty(this.additionalProperties[i], this.additionalProperties[i].getAllowedValues().toArray()[0]);
|
||||||
|
return state;
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public PropertyEnum<E> getMetaProperty()
|
||||||
|
{
|
||||||
|
return this.property;
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public boolean useCustomStateMapper()
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public String getCustomStateMapping(int meta, boolean itemBlock)
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public StateMapperBase getCustomMapper()
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean appendPropertiesToState()
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getUnlocalizedName(ItemStack stack)
|
||||||
|
{
|
||||||
|
String subName = getStateFromMeta(stack.getItemDamage()).getValue(property).toString().toLowerCase(Locale.US);
|
||||||
|
return super.getUnlocalizedName() + "." + subName;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected static Material setTempProperties(Material material, PropertyEnum<?> property, Object... additionalProperties)
|
||||||
|
{
|
||||||
|
ArrayList<IProperty> propList = new ArrayList<IProperty>();
|
||||||
|
ArrayList<IUnlistedProperty> unlistedPropList = new ArrayList<IUnlistedProperty>();
|
||||||
|
propList.add(property);
|
||||||
|
for(Object o : additionalProperties)
|
||||||
|
{
|
||||||
|
if(o instanceof IProperty)
|
||||||
|
propList.add((IProperty)o);
|
||||||
|
if(o instanceof IProperty[])
|
||||||
|
for(IProperty p : ((IProperty[])o))
|
||||||
|
propList.add(p);
|
||||||
|
if(o instanceof IUnlistedProperty)
|
||||||
|
unlistedPropList.add((IUnlistedProperty)o);
|
||||||
|
if(o instanceof IUnlistedProperty[])
|
||||||
|
for(IUnlistedProperty p : ((IUnlistedProperty[])o))
|
||||||
|
unlistedPropList.add(p);
|
||||||
|
}
|
||||||
|
tempProperties = propList.toArray(new IProperty[propList.size()]);
|
||||||
|
tempUnlistedProperties = unlistedPropList.toArray(new IUnlistedProperty[unlistedPropList.size()]);
|
||||||
|
return material;
|
||||||
|
}
|
||||||
|
protected static Object[] combineProperties(Object[] currentProperties, Object... addedProperties)
|
||||||
|
{
|
||||||
|
Object[] array = new Object[currentProperties.length + addedProperties.length];
|
||||||
|
for(int i=0; i<currentProperties.length; i++)
|
||||||
|
array[i] = currentProperties[i];
|
||||||
|
for(int i=0; i<addedProperties.length; i++)
|
||||||
|
array[currentProperties.length+i] = addedProperties[i];
|
||||||
|
return array;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BlockOSBase setMetaHidden(int... meta)
|
||||||
|
{
|
||||||
|
for(int i : meta)
|
||||||
|
if(i>=0 && i<this.isMetaHidden.length)
|
||||||
|
this.isMetaHidden[i] = true;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
public BlockOSBase setMetaUnhidden(int... meta)
|
||||||
|
{
|
||||||
|
for(int i : meta)
|
||||||
|
if(i>=0 && i<this.isMetaHidden.length)
|
||||||
|
this.isMetaHidden[i] = false;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
public boolean isMetaHidden(int meta)
|
||||||
|
{
|
||||||
|
return this.isMetaHidden[Math.max(0, Math.min(meta, this.isMetaHidden.length-1))];
|
||||||
|
}
|
||||||
|
|
||||||
|
public BlockOSBase setHasFlavour(int... meta)
|
||||||
|
{
|
||||||
|
if(meta==null||meta.length<1)
|
||||||
|
for(int i=0; i<hasFlavour.length; i++)
|
||||||
|
this.hasFlavour[i] = true;
|
||||||
|
else
|
||||||
|
for(int i : meta)
|
||||||
|
if(i>=0 && i<this.hasFlavour.length)
|
||||||
|
this.hasFlavour[i] = false;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
public boolean hasFlavour(ItemStack stack)
|
||||||
|
{
|
||||||
|
return this.hasFlavour[Math.max(0, Math.min(stack.getItemDamage(), this.hasFlavour.length-1))];
|
||||||
|
}
|
||||||
|
|
||||||
|
public BlockOSBase<E> setBlockLayer(BlockRenderLayer... layer)
|
||||||
|
{
|
||||||
|
this.renderLayers = Sets.newHashSet(layer);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
public BlockOSBase<E> setMetaBlockLayer(int meta, BlockRenderLayer... layer)
|
||||||
|
{
|
||||||
|
this.metaRenderLayers[Math.max(0, Math.min(meta, this.metaRenderLayers.length-1))] = Sets.newHashSet(layer);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public boolean canRenderInLayer(BlockRenderLayer layer)
|
||||||
|
{
|
||||||
|
if(cachedTileRequestState!=null)
|
||||||
|
{
|
||||||
|
int meta = this.getMetaFromState(cachedTileRequestState);
|
||||||
|
if(meta>=0 && meta<metaRenderLayers.length && metaRenderLayers[meta]!=null)
|
||||||
|
return metaRenderLayers[meta].contains(layer);
|
||||||
|
}
|
||||||
|
return renderLayers.contains(layer);
|
||||||
|
}
|
||||||
|
public BlockOSBase<E> setMetaLightOpacity(int meta, int opacity)
|
||||||
|
{
|
||||||
|
metaLightOpacities.put(meta, opacity);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public int getLightOpacity(IBlockState state, IBlockAccess w, BlockPos pos)
|
||||||
|
{
|
||||||
|
int meta = getMetaFromState(state);
|
||||||
|
if(metaLightOpacities.containsKey(meta))
|
||||||
|
return metaLightOpacities.get(meta);
|
||||||
|
return super.getLightOpacity(state,w,pos);
|
||||||
|
}
|
||||||
|
|
||||||
|
public BlockOSBase<E> setMetaExplosionResistance(int meta, int resistance)
|
||||||
|
{
|
||||||
|
metaResistances.put(meta, resistance);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public float getExplosionResistance(World world, BlockPos pos, Entity exploder, Explosion explosion)
|
||||||
|
{
|
||||||
|
int meta = getMetaFromState(world.getBlockState(pos));
|
||||||
|
if(metaResistances.containsKey(meta))
|
||||||
|
return metaResistances.get(meta);
|
||||||
|
return super.getExplosionResistance(world, pos, exploder, explosion);
|
||||||
|
}
|
||||||
|
|
||||||
|
public BlockOSBase<E> setNotNormalBlock(int meta)
|
||||||
|
{
|
||||||
|
if(metaNotNormalBlock == null)
|
||||||
|
metaNotNormalBlock = new boolean[this.enumValues.length];
|
||||||
|
metaNotNormalBlock[meta] = true;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
public BlockOSBase<E> setAllNotNormalBlock()
|
||||||
|
{
|
||||||
|
if(metaNotNormalBlock == null)
|
||||||
|
metaNotNormalBlock = new boolean[this.enumValues.length];
|
||||||
|
for(int i = 0; i < metaNotNormalBlock.length; i++)
|
||||||
|
metaNotNormalBlock[i] = true;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
protected boolean normalBlockCheck(IBlockState state)
|
||||||
|
{
|
||||||
|
if(metaNotNormalBlock == null)
|
||||||
|
return true;
|
||||||
|
int meta = getMetaFromState(state);
|
||||||
|
return (meta < 0 || meta >= metaNotNormalBlock.length) || !metaNotNormalBlock[meta];
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public boolean isFullBlock(IBlockState state)
|
||||||
|
{
|
||||||
|
return normalBlockCheck(state);
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public boolean isFullCube(IBlockState state)
|
||||||
|
{
|
||||||
|
return normalBlockCheck(state);
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public boolean isOpaqueCube(IBlockState state)
|
||||||
|
{
|
||||||
|
return normalBlockCheck(state);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isVisuallyOpaque()
|
||||||
|
{
|
||||||
|
if(metaNotNormalBlock == null)
|
||||||
|
return true;
|
||||||
|
int majority = 0;
|
||||||
|
for(boolean b : metaNotNormalBlock)
|
||||||
|
if(b)
|
||||||
|
majority++;
|
||||||
|
return majority<metaNotNormalBlock.length/2;
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public boolean isNormalCube(IBlockState state, IBlockAccess world, BlockPos pos)
|
||||||
|
{
|
||||||
|
return normalBlockCheck(state);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//This is a ridiculously hacky workaround, I would not recommend it to anyone.
|
||||||
|
protected static IBlockState cachedTileRequestState;
|
||||||
|
@Override
|
||||||
|
public boolean hasTileEntity(IBlockState state)
|
||||||
|
{
|
||||||
|
cachedTileRequestState = state;
|
||||||
|
return super.hasTileEntity(state);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected BlockStateContainer createNotTempBlockState()
|
||||||
|
{
|
||||||
|
IProperty[] array = new IProperty[1+this.additionalProperties.length];
|
||||||
|
array[0] = this.property;
|
||||||
|
for(int i=0; i<this.additionalProperties.length; i++)
|
||||||
|
array[1+i] = this.additionalProperties[i];
|
||||||
|
if(this.additionalUnlistedProperties.length>0)
|
||||||
|
return new ExtendedBlockState(this, array, additionalUnlistedProperties);
|
||||||
|
return new BlockStateContainer(this, array);
|
||||||
|
}
|
||||||
|
protected IBlockState getInitDefaultState()
|
||||||
|
{
|
||||||
|
IBlockState state = this.blockState.getBaseState().withProperty(this.property, enumValues[0]);
|
||||||
|
for(int i=0; i<this.additionalProperties.length; i++)
|
||||||
|
if(this.additionalProperties[i]!=null && !this.additionalProperties[i].getAllowedValues().isEmpty())
|
||||||
|
state = applyProperty(state, additionalProperties[i], additionalProperties[i].getAllowedValues().iterator().next());
|
||||||
|
return state;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected <V extends Comparable<V>> IBlockState applyProperty(IBlockState in, IProperty<V> prop, Object val)
|
||||||
|
{
|
||||||
|
return in.withProperty(prop, (V)val);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void onIEBlockPlacedBy(World world, BlockPos pos, IBlockState state, EnumFacing side, float hitX, float hitY, float hitZ, EntityLivingBase placer, ItemStack stack)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
public boolean canIEBlockBePlaced(World world, BlockPos pos, IBlockState newState, EnumFacing side, float hitX, float hitY, float hitZ, EntityPlayer player, ItemStack stack)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected BlockStateContainer createBlockState()
|
||||||
|
{
|
||||||
|
if(this.property!=null)
|
||||||
|
return createNotTempBlockState();
|
||||||
|
if(tempUnlistedProperties.length>0)
|
||||||
|
return new ExtendedBlockState(this, tempProperties, tempUnlistedProperties);
|
||||||
|
return new BlockStateContainer(this, tempProperties);
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public void onBlockPlacedBy(World worldIn, BlockPos pos, IBlockState state, EntityLivingBase placer, ItemStack stack)
|
||||||
|
{
|
||||||
|
super.onBlockPlacedBy(worldIn, pos, state, placer, stack);
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public int getMetaFromState(IBlockState state)
|
||||||
|
{
|
||||||
|
if(state==null || !this.equals(state.getBlock()))
|
||||||
|
return 0;
|
||||||
|
return state.getValue(this.property).getMeta();
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public IBlockState getActualState(IBlockState state, IBlockAccess world, BlockPos pos)
|
||||||
|
{
|
||||||
|
for(int i=0; i<this.additionalProperties.length; i++)
|
||||||
|
if(this.additionalProperties[i]!=null && !this.additionalProperties[i].getAllowedValues().isEmpty())
|
||||||
|
state = applyProperty(state, this.additionalProperties[i], this.additionalProperties[i].getAllowedValues().toArray()[0]);
|
||||||
|
return state;
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public IBlockState getStateFromMeta(int meta)
|
||||||
|
{
|
||||||
|
IBlockState state = this.getDefaultState().withProperty(this.property, fromMeta(meta));
|
||||||
|
for(int i=0; i<this.additionalProperties.length; i++)
|
||||||
|
if(this.additionalProperties[i]!=null && !this.additionalProperties[i].getAllowedValues().isEmpty())
|
||||||
|
state = applyProperty(state, this.additionalProperties[i], this.additionalProperties[i].getAllowedValues().toArray()[0]);
|
||||||
|
return state;
|
||||||
|
// return this.getDefaultState().withProperty(this.property, fromMeta(meta));
|
||||||
|
}
|
||||||
|
protected E fromMeta(int meta)
|
||||||
|
{
|
||||||
|
if(meta<0||meta>=enumValues.length)
|
||||||
|
meta = 0;
|
||||||
|
return enumValues[meta];
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int damageDropped(IBlockState state)
|
||||||
|
{
|
||||||
|
return getMetaFromState(state);
|
||||||
|
}
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
@Override
|
||||||
|
public void getSubBlocks(Item item, CreativeTabs tab, List<ItemStack> list)
|
||||||
|
{
|
||||||
|
for(E type : this.enumValues)
|
||||||
|
if(type.listForCreative() && !this.isMetaHidden[type.getMeta()])
|
||||||
|
list.add(new ItemStack(this, 1, type.getMeta()));
|
||||||
|
}
|
||||||
|
|
||||||
|
void adjustSound()
|
||||||
|
{
|
||||||
|
if(this.blockMaterial==Material.ANVIL)
|
||||||
|
this.blockSoundType = SoundType.ANVIL;
|
||||||
|
else if(this.blockMaterial==Material.CARPET||this.blockMaterial==Material.CLOTH)
|
||||||
|
this.blockSoundType = SoundType.CLOTH;
|
||||||
|
else if(this.blockMaterial==Material.GLASS||this.blockMaterial==Material.ICE)
|
||||||
|
this.blockSoundType = SoundType.GLASS;
|
||||||
|
else if(this.blockMaterial==Material.GRASS||this.blockMaterial==Material.TNT||this.blockMaterial==Material.PLANTS||this.blockMaterial==Material.VINE)
|
||||||
|
this.blockSoundType = SoundType.PLANT;
|
||||||
|
else if(this.blockMaterial==Material.GROUND)
|
||||||
|
this.blockSoundType = SoundType.GROUND;
|
||||||
|
else if(this.blockMaterial==Material.IRON)
|
||||||
|
this.blockSoundType = SoundType.METAL;
|
||||||
|
else if(this.blockMaterial==Material.SAND)
|
||||||
|
this.blockSoundType = SoundType.SAND;
|
||||||
|
else if(this.blockMaterial==Material.SNOW)
|
||||||
|
this.blockSoundType = SoundType.SNOW;
|
||||||
|
else if(this.blockMaterial==Material.ROCK)
|
||||||
|
this.blockSoundType = SoundType.STONE;
|
||||||
|
else if(this.blockMaterial==Material.WOOD||this.blockMaterial==Material.CACTUS)
|
||||||
|
this.blockSoundType = SoundType.WOOD;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean eventReceived(IBlockState state, World worldIn, BlockPos pos, int eventID, int eventParam)
|
||||||
|
{
|
||||||
|
if (worldIn.isRemote&&eventID==255)
|
||||||
|
{
|
||||||
|
worldIn.notifyBlockUpdate(pos,state,state,3);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return super.eventReceived(state, worldIn, pos, eventID, eventParam);
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean allowHammerHarvest(IBlockState blockState)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
public boolean allowWirecutterHarvest(IBlockState blockState)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
public boolean isOpaqueCube()
|
||||||
|
{
|
||||||
|
return opaqueCube;
|
||||||
|
}
|
||||||
|
public BlockOSBase<E> setOpaque(boolean isOpaque)
|
||||||
|
{
|
||||||
|
opaqueCube = isOpaque;
|
||||||
|
fullBlock = isOpaque;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
@Override
|
||||||
|
public boolean isToolEffective(String type, IBlockState state)
|
||||||
|
{
|
||||||
|
if(allowHammerHarvest(state) && type.equals(Lib.TOOL_HAMMER))
|
||||||
|
return true;
|
||||||
|
if(allowWirecutterHarvest(state) && type.equals(Lib.TOOL_WIRECUTTER))
|
||||||
|
return true;
|
||||||
|
return super.isToolEffective(type, state);
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
public String createRegistryName()
|
||||||
|
{
|
||||||
|
return OSRefs.MODID+":"+name;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public interface IBlockEnum extends IStringSerializable
|
||||||
|
{
|
||||||
|
int getMeta();
|
||||||
|
boolean listForCreative();
|
||||||
|
}
|
||||||
|
public abstract static class IELadderBlock<E extends Enum<E> & IBlockEnum> extends BlockOSBase<E>
|
||||||
|
{
|
||||||
|
public IELadderBlock(String name, Material material, PropertyEnum<E> mainProperty,
|
||||||
|
Class<? extends ItemBlockOSBase> itemBlock, Object... additionalProperties)
|
||||||
|
{
|
||||||
|
super(name, material, mainProperty, itemBlock, additionalProperties);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onEntityCollidedWithBlock(World worldIn, BlockPos pos, IBlockState state, Entity entityIn)
|
||||||
|
{
|
||||||
|
super.onEntityCollidedWithBlock(worldIn, pos, state, entityIn);
|
||||||
|
if (entityIn instanceof EntityLivingBase&&!((EntityLivingBase) entityIn).isOnLadder()&&isLadder(state, worldIn, pos, (EntityLivingBase)entityIn))
|
||||||
|
{
|
||||||
|
float f5 = 0.15F;
|
||||||
|
if (entityIn.motionX < -f5)
|
||||||
|
entityIn.motionX = -f5;
|
||||||
|
if (entityIn.motionX > f5)
|
||||||
|
entityIn.motionX = f5;
|
||||||
|
if (entityIn.motionZ < -f5)
|
||||||
|
entityIn.motionZ = -f5;
|
||||||
|
if (entityIn.motionZ > f5)
|
||||||
|
entityIn.motionZ = f5;
|
||||||
|
|
||||||
|
entityIn.fallDistance = 0.0F;
|
||||||
|
if (entityIn.motionY < -0.15D)
|
||||||
|
entityIn.motionY = -0.15D;
|
||||||
|
|
||||||
|
if(entityIn.motionY<0 && entityIn instanceof EntityPlayer && entityIn.isSneaking())
|
||||||
|
{
|
||||||
|
entityIn.motionY=.05;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if(entityIn.isCollidedHorizontally)
|
||||||
|
entityIn.motionY=.2;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,143 @@
|
|||||||
|
package fr.jackcartersmith.orbsat.block;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Locale;
|
||||||
|
|
||||||
|
import fr.jackcartersmith.orbsat.OSRefs;
|
||||||
|
import fr.jackcartersmith.orbsat.client.ClientProxy;
|
||||||
|
import fr.jackcartersmith.orbsat.common.util.ItemNBTHelper;
|
||||||
|
import net.minecraft.block.Block;
|
||||||
|
import net.minecraft.block.SoundType;
|
||||||
|
import net.minecraft.block.state.IBlockState;
|
||||||
|
import net.minecraft.client.gui.FontRenderer;
|
||||||
|
import net.minecraft.client.resources.I18n;
|
||||||
|
import net.minecraft.creativetab.CreativeTabs;
|
||||||
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import net.minecraft.init.Blocks;
|
||||||
|
import net.minecraft.item.Item;
|
||||||
|
import net.minecraft.item.ItemBlock;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.util.EnumActionResult;
|
||||||
|
import net.minecraft.util.EnumFacing;
|
||||||
|
import net.minecraft.util.EnumHand;
|
||||||
|
import net.minecraft.util.SoundCategory;
|
||||||
|
import net.minecraft.util.math.AxisAlignedBB;
|
||||||
|
import net.minecraft.util.math.BlockPos;
|
||||||
|
import net.minecraft.util.text.TextFormatting;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
import net.minecraftforge.fluids.FluidStack;
|
||||||
|
import net.minecraftforge.fml.relauncher.Side;
|
||||||
|
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
|
public class ItemBlockOSBase extends ItemBlock{
|
||||||
|
public ItemBlockOSBase(Block b)
|
||||||
|
{
|
||||||
|
super(b);
|
||||||
|
if(((BlockOSBase)b).enumValues.length>1)
|
||||||
|
setHasSubtypes(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getMetadata (int damageValue)
|
||||||
|
{
|
||||||
|
return damageValue;
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public void getSubItems(Item item, CreativeTabs tab, List<ItemStack> itemList)
|
||||||
|
{
|
||||||
|
this.block.getSubBlocks(item, tab, itemList);
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public String getUnlocalizedName(ItemStack stack)
|
||||||
|
{
|
||||||
|
return ((BlockOSBase) this.block).getUnlocalizedName(stack);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public FontRenderer getFontRenderer(ItemStack stack)
|
||||||
|
{
|
||||||
|
return ClientProxy.itemFont;
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void addInformation(ItemStack stack, EntityPlayer player, List<String> list, boolean advInfo)
|
||||||
|
{
|
||||||
|
if(((BlockOSBase)block).hasFlavour(stack))
|
||||||
|
{
|
||||||
|
String subName = ((BlockOSBase)this.block).getStateFromMeta(stack.getItemDamage()).getValue(((BlockOSBase)this.block).property).toString().toLowerCase(Locale.US);
|
||||||
|
String flavourKey = OSRefs.DESC_FLAVOUR+((BlockOSBase)this.block).name+"."+subName;
|
||||||
|
list.add(TextFormatting.GRAY.toString()+ I18n.format(flavourKey));
|
||||||
|
}
|
||||||
|
super.addInformation(stack, player, list, advInfo);
|
||||||
|
if(ItemNBTHelper.hasKey(stack, "energyStorage"))
|
||||||
|
list.add(I18n.format("desc.immersiveengineering.info.energyStored", ItemNBTHelper.getInt(stack, "energyStorage")));
|
||||||
|
if(ItemNBTHelper.hasKey(stack, "tank"))
|
||||||
|
{
|
||||||
|
FluidStack fs = FluidStack.loadFluidStackFromNBT(ItemNBTHelper.getTagCompound(stack, "tank"));
|
||||||
|
if(fs!=null)
|
||||||
|
list.add(fs.getLocalizedName()+": "+fs.amount+"mB");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean placeBlockAt(ItemStack stack, EntityPlayer player, World world, BlockPos pos, EnumFacing side, float hitX, float hitY, float hitZ, IBlockState newState)
|
||||||
|
{
|
||||||
|
if(!((BlockOSBase)this.block).canIEBlockBePlaced(world, pos, newState, side, hitX,hitY,hitZ, player, stack))
|
||||||
|
return false;
|
||||||
|
boolean ret = super.placeBlockAt(stack, player, world, pos, side, hitX, hitY, hitZ, newState);
|
||||||
|
if(ret)
|
||||||
|
{
|
||||||
|
((BlockOSBase)this.block).onIEBlockPlacedBy(world, pos, newState, side, hitX,hitY,hitZ, player, stack);
|
||||||
|
}
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public EnumActionResult onItemUse(ItemStack stack, EntityPlayer player, World world, BlockPos pos, EnumHand hand, EnumFacing side, float hitX, float hitY, float hitZ)
|
||||||
|
{
|
||||||
|
IBlockState iblockstate = world.getBlockState(pos);
|
||||||
|
Block block = iblockstate.getBlock();
|
||||||
|
if (!block.isReplaceable(world, pos))
|
||||||
|
pos = pos.offset(side);
|
||||||
|
if(stack.stackSize > 0 && player.canPlayerEdit(pos, side, stack) && canBlockBePlaced(world, pos, side, stack))
|
||||||
|
{
|
||||||
|
int i = this.getMetadata(stack.getMetadata());
|
||||||
|
IBlockState iblockstate1 = this.block.onBlockPlaced(world, pos, side, hitX, hitY, hitZ, i, player);
|
||||||
|
if(placeBlockAt(stack, player, world, pos, side, hitX, hitY, hitZ, iblockstate1))
|
||||||
|
{
|
||||||
|
SoundType soundtype = world.getBlockState(pos).getBlock().getSoundType(world.getBlockState(pos), world, pos, player);
|
||||||
|
world.playSound(player, pos, soundtype.getPlaceSound(), SoundCategory.BLOCKS, (soundtype.getVolume() + 1.0F) / 2.0F, soundtype.getPitch() * 0.8F);
|
||||||
|
if(!player.capabilities.isCreativeMode)
|
||||||
|
--stack.stackSize;
|
||||||
|
}
|
||||||
|
return EnumActionResult.SUCCESS;
|
||||||
|
}
|
||||||
|
return EnumActionResult.FAIL;
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public boolean canPlaceBlockOnSide(World worldIn, BlockPos pos, EnumFacing side, EntityPlayer player, ItemStack stack)
|
||||||
|
{
|
||||||
|
Block block = worldIn.getBlockState(pos).getBlock();
|
||||||
|
|
||||||
|
if(block == Blocks.SNOW_LAYER && block.isReplaceable(worldIn, pos))
|
||||||
|
{
|
||||||
|
side = EnumFacing.UP;
|
||||||
|
} else if(!block.isReplaceable(worldIn, pos))
|
||||||
|
{
|
||||||
|
pos = pos.offset(side);
|
||||||
|
}
|
||||||
|
|
||||||
|
return canBlockBePlaced(worldIn, pos, side, stack);
|
||||||
|
}
|
||||||
|
private boolean canBlockBePlaced(World w, BlockPos pos, EnumFacing side, ItemStack stack)
|
||||||
|
{
|
||||||
|
BlockOSBase blockIn = (BlockOSBase) this.block;
|
||||||
|
Block block = w.getBlockState(pos).getBlock();
|
||||||
|
AxisAlignedBB axisalignedbb = blockIn.getCollisionBoundingBox( blockIn.getStateFromMeta(stack.getItemDamage()), w, pos);
|
||||||
|
if (axisalignedbb != null && !w.checkNoEntityCollision(axisalignedbb.offset(pos), null)) return false;
|
||||||
|
return block.isReplaceable(w, pos) && blockIn.canReplace(w, pos, side, stack);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,280 @@
|
|||||||
|
package fr.jackcartersmith.orbsat.block;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collection;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import javax.annotation.Nullable;
|
||||||
|
|
||||||
|
import fr.jackcartersmith.orbsat.OSEnums;
|
||||||
|
import fr.jackcartersmith.orbsat.OSProperties.PropertyBoolInverted;
|
||||||
|
import net.minecraft.block.BlockPistonBase;
|
||||||
|
import net.minecraft.block.properties.IProperty;
|
||||||
|
import net.minecraft.block.properties.PropertyInteger;
|
||||||
|
import net.minecraft.block.state.IBlockState;
|
||||||
|
import net.minecraft.client.renderer.block.statemap.StateMapperBase;
|
||||||
|
import net.minecraft.entity.Entity;
|
||||||
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.tileentity.TileEntity;
|
||||||
|
import net.minecraft.util.EnumFacing;
|
||||||
|
import net.minecraft.util.EnumHand;
|
||||||
|
import net.minecraft.util.EnumFacing.Axis;
|
||||||
|
import net.minecraft.util.math.AxisAlignedBB;
|
||||||
|
import net.minecraft.util.math.BlockPos;
|
||||||
|
import net.minecraft.util.math.RayTraceResult;
|
||||||
|
import net.minecraft.world.IBlockAccess;
|
||||||
|
import net.minecraftforge.client.model.obj.OBJModel.OBJState;
|
||||||
|
import net.minecraftforge.fml.relauncher.Side;
|
||||||
|
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
|
public class OSBlockInterface {
|
||||||
|
public interface IOSMetaBlock
|
||||||
|
{
|
||||||
|
String getOSBlockName();
|
||||||
|
IProperty getMetaProperty();
|
||||||
|
Enum[] getMetaEnums();
|
||||||
|
IBlockState getInventoryState(int meta);
|
||||||
|
boolean useCustomStateMapper();
|
||||||
|
String getCustomStateMapping(int meta, boolean itemBlock);
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
StateMapperBase getCustomMapper();
|
||||||
|
|
||||||
|
boolean appendPropertiesToState();
|
||||||
|
}
|
||||||
|
|
||||||
|
public interface IAttachedIntegerProperies
|
||||||
|
{
|
||||||
|
String[] getIntPropertyNames();
|
||||||
|
PropertyInteger getIntProperty(String name);
|
||||||
|
int getIntPropertyValue(String name);
|
||||||
|
}
|
||||||
|
|
||||||
|
public interface IUsesBooleanProperty
|
||||||
|
{
|
||||||
|
PropertyBoolInverted getBoolProperty(Class<? extends IUsesBooleanProperty> inf);
|
||||||
|
}
|
||||||
|
|
||||||
|
public interface IBlockOverlayText
|
||||||
|
{
|
||||||
|
String[] getOverlayText(EntityPlayer player, RayTraceResult mop, boolean hammer);
|
||||||
|
boolean useNixieFont(EntityPlayer player, RayTraceResult mop);
|
||||||
|
}
|
||||||
|
|
||||||
|
public interface ISoundTile
|
||||||
|
{
|
||||||
|
boolean shoudlPlaySound(String sound);
|
||||||
|
}
|
||||||
|
|
||||||
|
public interface ISpawnInterdiction
|
||||||
|
{
|
||||||
|
double getInterdictionRangeSquared();
|
||||||
|
}
|
||||||
|
|
||||||
|
public interface IComparatorOverride
|
||||||
|
{
|
||||||
|
int getComparatorInputOverride();
|
||||||
|
}
|
||||||
|
|
||||||
|
public interface IRedstoneOutput
|
||||||
|
{
|
||||||
|
default int getWeakRSOutput(IBlockState state, EnumFacing side)
|
||||||
|
{
|
||||||
|
return getStrongRSOutput(state, side);
|
||||||
|
}
|
||||||
|
|
||||||
|
int getStrongRSOutput(IBlockState state, EnumFacing side);
|
||||||
|
|
||||||
|
boolean canConnectRedstone(IBlockState state, EnumFacing side);
|
||||||
|
}
|
||||||
|
|
||||||
|
public interface ILightValue
|
||||||
|
{
|
||||||
|
int getLightValue();
|
||||||
|
}
|
||||||
|
|
||||||
|
public interface IColouredBlock
|
||||||
|
{
|
||||||
|
boolean hasCustomBlockColours();
|
||||||
|
int getRenderColour(IBlockState state, @Nullable IBlockAccess worldIn, @Nullable BlockPos pos, int tintIndex);
|
||||||
|
}
|
||||||
|
public interface IColouredTile
|
||||||
|
{
|
||||||
|
int getRenderColour(int tintIndex);
|
||||||
|
}
|
||||||
|
|
||||||
|
public interface IDirectionalTile
|
||||||
|
{
|
||||||
|
EnumFacing getFacing();
|
||||||
|
void setFacing(EnumFacing facing);
|
||||||
|
/**
|
||||||
|
* @return 0 = side clicked, 1=piston behaviour, 2 = horizontal, 3 = vertical, 4 = x/z axis, 5 = horizontal based on quadrant
|
||||||
|
*/
|
||||||
|
int getFacingLimitation();
|
||||||
|
default EnumFacing getFacingForPlacement(EntityLivingBase placer, BlockPos pos, EnumFacing side, float hitX, float hitY, float hitZ)
|
||||||
|
{
|
||||||
|
EnumFacing f = EnumFacing.DOWN;
|
||||||
|
int limit = getFacingLimitation();
|
||||||
|
if(limit==0)
|
||||||
|
f = side;
|
||||||
|
else if(limit==1)
|
||||||
|
f = BlockPistonBase.getFacingFromEntity(pos, placer);
|
||||||
|
else if(limit==2)
|
||||||
|
f = EnumFacing.fromAngle(placer.rotationYaw);
|
||||||
|
else if(limit==3)
|
||||||
|
f = (side!=EnumFacing.DOWN&&(side==EnumFacing.UP||hitY<=.5))?EnumFacing.UP : EnumFacing.DOWN;
|
||||||
|
else if(limit==4)
|
||||||
|
{
|
||||||
|
f = EnumFacing.fromAngle(placer.rotationYaw);
|
||||||
|
if(f==EnumFacing.SOUTH || f==EnumFacing.WEST)
|
||||||
|
f = f.getOpposite();
|
||||||
|
} else if(limit == 5)
|
||||||
|
{
|
||||||
|
if(side.getAxis() != Axis.Y)
|
||||||
|
f = side.getOpposite();
|
||||||
|
else
|
||||||
|
{
|
||||||
|
float xFromMid = hitX - .5f;
|
||||||
|
float zFromMid = hitZ - .5f;
|
||||||
|
float max = Math.max(Math.abs(xFromMid), Math.abs(zFromMid));
|
||||||
|
if(max == Math.abs(xFromMid))
|
||||||
|
f = xFromMid < 0 ? EnumFacing.WEST : EnumFacing.EAST;
|
||||||
|
else
|
||||||
|
f = zFromMid < 0 ? EnumFacing.NORTH : EnumFacing.SOUTH;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return mirrorFacingOnPlacement(placer)?f.getOpposite():f;
|
||||||
|
}
|
||||||
|
boolean mirrorFacingOnPlacement(EntityLivingBase placer);
|
||||||
|
boolean canHammerRotate(EnumFacing side, float hitX, float hitY, float hitZ, EntityLivingBase entity);
|
||||||
|
boolean canRotate(EnumFacing axis);
|
||||||
|
default void afterRotation(EnumFacing oldDir, EnumFacing newDir){}
|
||||||
|
}
|
||||||
|
public interface IAdvancedDirectionalTile extends IDirectionalTile
|
||||||
|
{
|
||||||
|
void onDirectionalPlacement(EnumFacing side, float hitX, float hitY, float hitZ, EntityLivingBase placer);
|
||||||
|
}
|
||||||
|
|
||||||
|
public interface IConfigurableSides
|
||||||
|
{
|
||||||
|
OSEnums.SideConfig getSideConfig(int side);
|
||||||
|
default boolean toggleSide(int side, EntityPlayer p)
|
||||||
|
{
|
||||||
|
toggleSide(side);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
@Deprecated
|
||||||
|
default void toggleSide(int side)
|
||||||
|
{}
|
||||||
|
}
|
||||||
|
|
||||||
|
public interface ITileDrop
|
||||||
|
{
|
||||||
|
ItemStack getTileDrop(EntityPlayer player, IBlockState state);
|
||||||
|
|
||||||
|
void readOnPlacement(@Nullable EntityLivingBase placer, ItemStack stack);
|
||||||
|
|
||||||
|
default boolean preventInventoryDrop() { return false; }
|
||||||
|
}
|
||||||
|
public interface IAdditionalDrops
|
||||||
|
{
|
||||||
|
Collection<ItemStack> getExtraDrops(EntityPlayer player, IBlockState state);
|
||||||
|
}
|
||||||
|
|
||||||
|
public interface IEntityProof
|
||||||
|
{
|
||||||
|
boolean canEntityDestroy(Entity entity);
|
||||||
|
}
|
||||||
|
|
||||||
|
public interface IPlayerInteraction
|
||||||
|
{
|
||||||
|
boolean interact(EnumFacing side, EntityPlayer player, EnumHand hand, ItemStack heldItem, float hitX, float hitY, float hitZ);
|
||||||
|
}
|
||||||
|
|
||||||
|
public interface IHammerInteraction
|
||||||
|
{
|
||||||
|
boolean hammerUseSide(EnumFacing side, EntityPlayer player, float hitX, float hitY, float hitZ);
|
||||||
|
}
|
||||||
|
|
||||||
|
public interface IActiveState extends IUsesBooleanProperty
|
||||||
|
{
|
||||||
|
boolean getIsActive();
|
||||||
|
}
|
||||||
|
|
||||||
|
public interface IDualState extends IUsesBooleanProperty
|
||||||
|
{
|
||||||
|
boolean getIsSecondState();
|
||||||
|
}
|
||||||
|
|
||||||
|
public interface IMirrorAble extends IUsesBooleanProperty
|
||||||
|
{
|
||||||
|
boolean getIsMirrored();
|
||||||
|
}
|
||||||
|
|
||||||
|
public interface IBlockBounds
|
||||||
|
{
|
||||||
|
float[] getBlockBounds();
|
||||||
|
}
|
||||||
|
public interface IAdvancedSelectionBounds extends IBlockBounds
|
||||||
|
{
|
||||||
|
List<AxisAlignedBB> getAdvancedSelectionBounds();
|
||||||
|
boolean isOverrideBox(AxisAlignedBB box, EntityPlayer player, RayTraceResult mop, ArrayList<AxisAlignedBB> list);
|
||||||
|
}
|
||||||
|
public interface IAdvancedCollisionBounds extends IBlockBounds
|
||||||
|
{
|
||||||
|
List<AxisAlignedBB> getAdvancedColisionBounds();
|
||||||
|
}
|
||||||
|
|
||||||
|
public interface IHasDummyBlocks
|
||||||
|
{
|
||||||
|
boolean isDummy();
|
||||||
|
void placeDummies(BlockPos pos, IBlockState state, EnumFacing side, float hitX, float hitY, float hitZ);
|
||||||
|
void breakDummies(BlockPos pos, IBlockState state);
|
||||||
|
}
|
||||||
|
|
||||||
|
public interface IHasObjProperty
|
||||||
|
{
|
||||||
|
ArrayList<String> compileDisplayList();
|
||||||
|
}
|
||||||
|
public interface IAdvancedHasObjProperty
|
||||||
|
{
|
||||||
|
OBJState getOBJState();
|
||||||
|
}
|
||||||
|
public interface IDynamicTexture
|
||||||
|
{
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
HashMap<String,String> getTextureReplacements();
|
||||||
|
}
|
||||||
|
|
||||||
|
public interface IGuiTile
|
||||||
|
{
|
||||||
|
default boolean canOpenGui(EntityPlayer player)
|
||||||
|
{
|
||||||
|
return canOpenGui();
|
||||||
|
}
|
||||||
|
boolean canOpenGui();
|
||||||
|
int getGuiID();
|
||||||
|
TileEntity getGuiMaster();
|
||||||
|
|
||||||
|
default void onGuiOpened(EntityPlayer player, boolean clientside)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public interface IProcessTile
|
||||||
|
{
|
||||||
|
int[] getCurrentProcessesStep();
|
||||||
|
int[] getCurrentProcessesMax();
|
||||||
|
}
|
||||||
|
|
||||||
|
public interface INeighbourChangeTile
|
||||||
|
{
|
||||||
|
void onNeighborBlockChange(BlockPos pos);
|
||||||
|
}
|
||||||
|
|
||||||
|
public interface IPropertyPassthrough
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
@ -1,9 +1,13 @@
|
|||||||
package fr.jackcartersmith.orbsat.client;
|
package fr.jackcartersmith.orbsat.client;
|
||||||
|
|
||||||
|
import java.util.Locale;
|
||||||
|
|
||||||
import fr.jackcartersmith.orbsat.OSRefs;
|
import fr.jackcartersmith.orbsat.OSRefs;
|
||||||
|
import fr.jackcartersmith.orbsat.block.OSBlockInterface.IOSMetaBlock;
|
||||||
import fr.jackcartersmith.orbsat.common.CommonProxy;
|
import fr.jackcartersmith.orbsat.common.CommonProxy;
|
||||||
import fr.jackcartersmith.orbsat.common.util.OSLogger;
|
|
||||||
import fr.jackcartersmith.orbsat.item.ItemOSBase;
|
import fr.jackcartersmith.orbsat.item.ItemOSBase;
|
||||||
|
import net.minecraft.block.Block;
|
||||||
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.client.renderer.ItemMeshDefinition;
|
import net.minecraft.client.renderer.ItemMeshDefinition;
|
||||||
import net.minecraft.client.renderer.block.model.ModelBakery;
|
import net.minecraft.client.renderer.block.model.ModelBakery;
|
||||||
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
|
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
|
||||||
@ -22,6 +26,46 @@ public class ClientProxy extends CommonProxy{
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void preInit(){
|
public void preInit(){
|
||||||
|
Minecraft.getMinecraft().getFramebuffer().enableStencil();//Enabling FBO stencils
|
||||||
|
|
||||||
|
for(Block block : OSRefs.registeredOSBlocks)
|
||||||
|
{
|
||||||
|
Item blockItem = Item.getItemFromBlock(block);
|
||||||
|
final ResourceLocation loc = GameData.getBlockRegistry().getNameForObject(block);
|
||||||
|
if(block instanceof IOSMetaBlock)
|
||||||
|
{
|
||||||
|
IOSMetaBlock ieMetaBlock = (IOSMetaBlock) block;
|
||||||
|
if(ieMetaBlock.useCustomStateMapper())
|
||||||
|
ModelLoader.setCustomStateMapper(block, OSCustomStateMapper.getStateMapper(ieMetaBlock));
|
||||||
|
ModelLoader.setCustomMeshDefinition(blockItem, new ItemMeshDefinition()
|
||||||
|
{
|
||||||
|
@Override
|
||||||
|
public ModelResourceLocation getModelLocation(ItemStack stack)
|
||||||
|
{
|
||||||
|
return new ModelResourceLocation(loc, "inventory");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
for(int meta = 0; meta < ieMetaBlock.getMetaEnums().length; meta++)
|
||||||
|
{
|
||||||
|
String location = loc.toString();
|
||||||
|
String prop = ieMetaBlock.appendPropertiesToState() ? ("inventory," + ieMetaBlock.getMetaProperty().getName() + "=" + ieMetaBlock.getMetaEnums()[meta].toString().toLowerCase(Locale.US)) : null;
|
||||||
|
if(ieMetaBlock.useCustomStateMapper())
|
||||||
|
{
|
||||||
|
String custom = ieMetaBlock.getCustomStateMapping(meta, true);
|
||||||
|
if(custom != null)
|
||||||
|
location += "_" + custom;
|
||||||
|
}
|
||||||
|
try
|
||||||
|
{
|
||||||
|
ModelLoader.setCustomModelResourceLocation(blockItem, meta, new ModelResourceLocation(location, prop));
|
||||||
|
} catch(NullPointerException npe)
|
||||||
|
{
|
||||||
|
throw new RuntimeException("WELP! apparently " + ieMetaBlock + " lacks an item!", npe);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else
|
||||||
|
ModelLoader.setCustomModelResourceLocation(blockItem, 0, new ModelResourceLocation(loc, "inventory"));
|
||||||
|
}
|
||||||
|
|
||||||
for(Item item : OSRefs.registeredOSItems)
|
for(Item item : OSRefs.registeredOSItems)
|
||||||
{
|
{
|
||||||
|
@ -0,0 +1,46 @@
|
|||||||
|
package fr.jackcartersmith.orbsat.client;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
|
||||||
|
import fr.jackcartersmith.orbsat.block.OSBlockInterface.IOSMetaBlock;
|
||||||
|
import net.minecraft.block.Block;
|
||||||
|
import net.minecraft.block.state.IBlockState;
|
||||||
|
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
|
||||||
|
import net.minecraft.client.renderer.block.statemap.StateMapperBase;
|
||||||
|
import net.minecraft.util.ResourceLocation;
|
||||||
|
|
||||||
|
public class OSCustomStateMapper extends StateMapperBase{
|
||||||
|
public static HashMap<String, StateMapperBase> stateMappers = new HashMap<>();
|
||||||
|
public static StateMapperBase getStateMapper(IOSMetaBlock metaBlock)
|
||||||
|
{
|
||||||
|
String key = metaBlock.getOSBlockName();
|
||||||
|
StateMapperBase mapper = stateMappers.get(key);
|
||||||
|
if(mapper==null)
|
||||||
|
{
|
||||||
|
mapper = metaBlock.getCustomMapper();
|
||||||
|
if(mapper==null)
|
||||||
|
mapper = new OSCustomStateMapper();
|
||||||
|
stateMappers.put(key, mapper);
|
||||||
|
}
|
||||||
|
return mapper;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected ModelResourceLocation getModelResourceLocation(IBlockState state)
|
||||||
|
{
|
||||||
|
try{
|
||||||
|
ResourceLocation rl = Block.REGISTRY.getNameForObject(state.getBlock());
|
||||||
|
IOSMetaBlock metaBlock = (IOSMetaBlock)state.getBlock();
|
||||||
|
String custom = metaBlock.getCustomStateMapping(state.getBlock().getMetaFromState(state), false);
|
||||||
|
if(custom!=null)
|
||||||
|
rl = new ResourceLocation(rl.toString()+"_"+custom);
|
||||||
|
String prop = metaBlock.appendPropertiesToState()?this.getPropertyString(state.getProperties()):null;
|
||||||
|
return new ModelResourceLocation(rl, prop);
|
||||||
|
}catch(Exception e)
|
||||||
|
{
|
||||||
|
e.printStackTrace();
|
||||||
|
ResourceLocation rl = Block.REGISTRY.getNameForObject(state.getBlock());
|
||||||
|
return new ModelResourceLocation(rl, this.getPropertyString(state.getProperties()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -9,8 +9,8 @@ import java.util.Calendar;
|
|||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import com.google.common.collect.Maps;
|
import fr.jackcartersmith.orbsat.OSRefs;
|
||||||
|
import fr.jackcartersmith.orbsat.common.Config.OSConfig.Machines;
|
||||||
import fr.jackcartersmith.orbsat.common.util.OSLogger;
|
import fr.jackcartersmith.orbsat.common.util.OSLogger;
|
||||||
import net.minecraftforge.common.config.Configuration;
|
import net.minecraftforge.common.config.Configuration;
|
||||||
import net.minecraftforge.common.config.Config.Comment;
|
import net.minecraftforge.common.config.Config.Comment;
|
||||||
@ -25,7 +25,7 @@ public class Config {
|
|||||||
|
|
||||||
public static boolean seaonal_festive = false;
|
public static boolean seaonal_festive = false;
|
||||||
|
|
||||||
@net.minecraftforge.common.config.Config(modid="orbsat")
|
@net.minecraftforge.common.config.Config(modid=OSRefs.MODID)
|
||||||
public static class OSConfig
|
public static class OSConfig
|
||||||
{
|
{
|
||||||
//Wire Stuff
|
//Wire Stuff
|
||||||
@ -42,7 +42,10 @@ public class Config {
|
|||||||
public static int[] wireLength = new int[]{16, 16, 32, 32, 32, 32};
|
public static int[] wireLength = new int[]{16, 16, 32, 32, 32, 32};
|
||||||
|
|
||||||
@Comment({"By default all devices that accept cables have increased renderbounds to show cables even if the block itself is not in view.", "Disabling this reduces them to their minimum sizes, which might improve FPS on low-power PCs"})
|
@Comment({"By default all devices that accept cables have increased renderbounds to show cables even if the block itself is not in view.", "Disabling this reduces them to their minimum sizes, which might improve FPS on low-power PCs"})
|
||||||
|
//TODO this is for TESR wires. Remove?
|
||||||
public static boolean increasedRenderboxes = true;
|
public static boolean increasedRenderboxes = true;
|
||||||
|
@Comment({"Disables most lighting code for certain models that are rendered dynamically (TESR). May improve FPS.", "Affects turrets and garden cloches"})
|
||||||
|
public static boolean disableFancyTESR = false;
|
||||||
@Comment({"Support for colourblind people, gives a text-based output on capacitor sides"})
|
@Comment({"Support for colourblind people, gives a text-based output on capacitor sides"})
|
||||||
public static boolean colourblindSupport = false;
|
public static boolean colourblindSupport = false;
|
||||||
@Comment({"Set this to false to disable the super awesome looking nixie tube front for the voltmeter and other things"})
|
@Comment({"Set this to false to disable the super awesome looking nixie tube front for the voltmeter and other things"})
|
||||||
@ -55,6 +58,8 @@ public class Config {
|
|||||||
public static boolean oreTooltips = true;
|
public static boolean oreTooltips = true;
|
||||||
@Comment({"Increase the distance at which certain TileEntities (specifically windmills) are still visible. This is a modifier, so set it to 1 for default render distance, to 2 for doubled distance and so on."})
|
@Comment({"Increase the distance at which certain TileEntities (specifically windmills) are still visible. This is a modifier, so set it to 1 for default render distance, to 2 for doubled distance and so on."})
|
||||||
public static double increasedTileRenderdistance = 1.5;
|
public static double increasedTileRenderdistance = 1.5;
|
||||||
|
@Comment({"A list of preferred Mod IDs that results of IE processes should stem from, aka which mod you want the copper to come from.", "This affects the ores dug by the excavator, as well as those crushing recipes that don't have associated IE items. This list is in oreder of priority."})
|
||||||
|
public static String[] preferredOres = new String[]{OSRefs.MODID};
|
||||||
@Comment({"Set this to false to hide the update news in the manual"})
|
@Comment({"Set this to false to hide the update news in the manual"})
|
||||||
public static boolean showUpdateNews = true;
|
public static boolean showUpdateNews = true;
|
||||||
@Comment({"Set this to false to stop the IE villager house from spawning"})
|
@Comment({"Set this to false to stop the IE villager house from spawning"})
|
||||||
@ -64,7 +69,6 @@ public class Config {
|
|||||||
@Comment({"The weight that hempseeds have when breaking tall grass. 5 by default, set to 0 to disable drops"})
|
@Comment({"The weight that hempseeds have when breaking tall grass. 5 by default, set to 0 to disable drops"})
|
||||||
public static int hempSeedWeight = 5;
|
public static int hempSeedWeight = 5;
|
||||||
|
|
||||||
|
|
||||||
public static Machines machines = new Machines();
|
public static Machines machines = new Machines();
|
||||||
public static Ores ores = new Ores();
|
public static Ores ores = new Ores();
|
||||||
public static Tools tools = new Tools();
|
public static Tools tools = new Tools();
|
||||||
@ -269,8 +273,6 @@ public class Config {
|
|||||||
public static boolean retrogen_log_flagChunk = true;
|
public static boolean retrogen_log_flagChunk = true;
|
||||||
@Comment({"Set this to false to disable the logging of the chunks that are still left to retrogen."})
|
@Comment({"Set this to false to disable the logging of the chunks that are still left to retrogen."})
|
||||||
public static boolean retrogen_log_remaining = true;
|
public static boolean retrogen_log_remaining = true;
|
||||||
@Comment({"The retrogeneration key. Basically IE checks if this key is saved in the chunks data. If it isn't, it will perform retrogen on all ores marked for retrogen.", "Change this in combination with the retrogen booleans to regen only some of the ores."})
|
|
||||||
public static String retrogen_key = "DEFAULT";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -323,6 +325,8 @@ public class Config {
|
|||||||
Calendar calendar = Calendar.getInstance();
|
Calendar calendar = Calendar.getInstance();
|
||||||
seaonal_festive = calendar.get(Calendar.MONTH)+1==12;//December
|
seaonal_festive = calendar.get(Calendar.MONTH)+1==12;//December
|
||||||
|
|
||||||
|
Config.manual_int.put("excavator_depletion_days", Machines.excavator_depletion*45/24000);
|
||||||
|
Config.manual_bool.put("literalRailGun", false);//preventive measure for Railcraft
|
||||||
checkMappedValues(OSConfig.class);
|
checkMappedValues(OSConfig.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -0,0 +1,247 @@
|
|||||||
|
package fr.jackcartersmith.orbsat.common.util;
|
||||||
|
|
||||||
|
import net.minecraft.entity.Entity;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
|
import net.minecraft.nbt.NBTTagList;
|
||||||
|
import net.minecraft.nbt.NBTTagString;
|
||||||
|
import net.minecraftforge.fluids.FluidStack;
|
||||||
|
import net.minecraftforge.fluids.capability.templates.FluidHandlerItemStack;
|
||||||
|
|
||||||
|
public class ItemNBTHelper {
|
||||||
|
public static NBTTagCompound getTag(ItemStack stack)
|
||||||
|
{
|
||||||
|
if(!stack.hasTagCompound())
|
||||||
|
stack.setTagCompound(new NBTTagCompound());
|
||||||
|
return stack.getTagCompound();
|
||||||
|
}
|
||||||
|
public static boolean hasTag(ItemStack stack)
|
||||||
|
{
|
||||||
|
return stack.hasTagCompound();
|
||||||
|
}
|
||||||
|
public static boolean hasKey(ItemStack stack, String key)
|
||||||
|
{
|
||||||
|
return hasTag(stack) && getTag(stack).hasKey(key);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void remove(ItemStack stack, String key)
|
||||||
|
{
|
||||||
|
if(hasKey(stack, key))
|
||||||
|
{
|
||||||
|
getTag(stack).removeTag(key);
|
||||||
|
if(getTag(stack).hasNoTags())
|
||||||
|
stack.setTagCompound(null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static void setInt(ItemStack stack, String key, int val)
|
||||||
|
{
|
||||||
|
getTag(stack).setInteger(key, val);
|
||||||
|
}
|
||||||
|
public static void modifyInt(ItemStack stack, String key, int mod)
|
||||||
|
{
|
||||||
|
getTag(stack).setInteger(key, getTag(stack).getInteger(key)+mod);
|
||||||
|
}
|
||||||
|
public static int getInt(ItemStack stack, String key)
|
||||||
|
{
|
||||||
|
return hasTag(stack) ? getTag(stack).getInteger(key) : 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void setString(ItemStack stack, String key, String val)
|
||||||
|
{
|
||||||
|
getTag(stack).setString(key, val);
|
||||||
|
}
|
||||||
|
public static String getString(ItemStack stack, String key)
|
||||||
|
{
|
||||||
|
return hasTag(stack) ? getTag(stack).getString(key) : "";
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void setLong(ItemStack stack, String key, long val)
|
||||||
|
{
|
||||||
|
getTag(stack).setLong(key, val);
|
||||||
|
}
|
||||||
|
public static long getLong(ItemStack stack, String key)
|
||||||
|
{
|
||||||
|
return hasTag(stack) ? getTag(stack).getLong(key) : 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void setIntArray(ItemStack stack, String key, int[] val)
|
||||||
|
{
|
||||||
|
getTag(stack).setIntArray(key, val);
|
||||||
|
}
|
||||||
|
public static int[] getIntArray(ItemStack stack, String key)
|
||||||
|
{
|
||||||
|
return hasTag(stack) ? getTag(stack).getIntArray(key) : new int[0];
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void setFloat(ItemStack stack, String key, float val)
|
||||||
|
{
|
||||||
|
getTag(stack).setFloat(key, val);
|
||||||
|
}
|
||||||
|
public static float getFloat(ItemStack stack, String key)
|
||||||
|
{
|
||||||
|
return hasTag(stack) ? getTag(stack).getFloat(key) : 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void setBoolean(ItemStack stack, String key, boolean val)
|
||||||
|
{
|
||||||
|
getTag(stack).setBoolean(key, val);
|
||||||
|
}
|
||||||
|
public static boolean getBoolean(ItemStack stack, String key)
|
||||||
|
{
|
||||||
|
return hasTag(stack) && getTag(stack).getBoolean(key);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void setTagCompound(ItemStack stack, String key, NBTTagCompound val)
|
||||||
|
{
|
||||||
|
getTag(stack).setTag(key, val);
|
||||||
|
}
|
||||||
|
public static NBTTagCompound getTagCompound(ItemStack stack, String key)
|
||||||
|
{
|
||||||
|
return hasTag(stack) ? getTag(stack).getCompoundTag(key) : new NBTTagCompound();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void setDelayedSoundsForStack(ItemStack stack, String nbtKey, String sound, float volume, float pitch, int amount, int baseDelay, int iDelay)
|
||||||
|
{
|
||||||
|
int[] delayedSounds = new int[amount];
|
||||||
|
for(int i=0; i<delayedSounds.length; i++)
|
||||||
|
delayedSounds[i]=baseDelay+i*iDelay;
|
||||||
|
|
||||||
|
setIntArray(stack, "delayedSound_"+nbtKey+"_delay", delayedSounds);
|
||||||
|
setString(stack, "delayedSound_"+nbtKey+"_sound", sound);
|
||||||
|
setFloat(stack, "delayedSound_"+nbtKey+"_volume", volume);
|
||||||
|
setFloat(stack, "delayedSound_"+nbtKey+"_pitch", pitch);
|
||||||
|
}
|
||||||
|
public static int handleDelayedSoundsForStack(ItemStack stack, String nbtKey, Entity ent)
|
||||||
|
{
|
||||||
|
if(!hasKey(stack, "delayedSound_"+nbtKey+"_delay"))
|
||||||
|
return -1;
|
||||||
|
int[] delayedSounds = ItemNBTHelper.getIntArray(stack, "delayedSound_"+nbtKey+"_delay");
|
||||||
|
int l = 0;
|
||||||
|
for(int i=0; i<delayedSounds.length; i++)
|
||||||
|
{
|
||||||
|
--delayedSounds[i];
|
||||||
|
if(delayedSounds[i]<=0)
|
||||||
|
{
|
||||||
|
//ToDo: Delayed Sounds could be nicer anyway.
|
||||||
|
// ent.playSound();
|
||||||
|
// ent.worldObj.playSoundAtEntity(ent, getString(stack, "delayedSound_"+nbtKey+"_sound"), getFloat(stack, "delayedSound_"+nbtKey+"_volume"), getFloat(stack, "delayedSound_"+nbtKey+"_pitch"));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
++l;
|
||||||
|
}
|
||||||
|
if(l>0)
|
||||||
|
{
|
||||||
|
ItemNBTHelper.setIntArray(stack, "delayedSound_"+nbtKey+"_delay", delayedSounds);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ItemNBTHelper.remove(stack, "delayedSound_"+nbtKey+"_delay");
|
||||||
|
ItemNBTHelper.remove(stack, "delayedSound_"+nbtKey+"_sound");
|
||||||
|
ItemNBTHelper.remove(stack, "delayedSound_"+nbtKey+"_volume");
|
||||||
|
ItemNBTHelper.remove(stack, "delayedSound_"+nbtKey+"_pitch");
|
||||||
|
}
|
||||||
|
return l;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void setFluidStack(ItemStack stack, String key, FluidStack val)
|
||||||
|
{
|
||||||
|
if(val!=null && val.getFluid()!=null)
|
||||||
|
{
|
||||||
|
NBTTagCompound tag = getTagCompound(stack, key);
|
||||||
|
setTagCompound(stack, FluidHandlerItemStack.FLUID_NBT_KEY, val.writeToNBT(new NBTTagCompound()));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
remove(stack, FluidHandlerItemStack.FLUID_NBT_KEY);
|
||||||
|
}
|
||||||
|
public static FluidStack getFluidStack(ItemStack stack, String key)
|
||||||
|
{
|
||||||
|
if(hasTag(stack))
|
||||||
|
{
|
||||||
|
NBTTagCompound tag = getTagCompound(stack, key);
|
||||||
|
return FluidStack.loadFluidStackFromNBT(tag.getCompoundTag(FluidHandlerItemStack.FLUID_NBT_KEY));
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void setItemStack(ItemStack stack, String key, ItemStack val)
|
||||||
|
{
|
||||||
|
getTag(stack).setTag(key, val.writeToNBT(new NBTTagCompound()));
|
||||||
|
}
|
||||||
|
public static ItemStack getItemStack(ItemStack stack, String key)
|
||||||
|
{
|
||||||
|
if(hasTag(stack) && getTag(stack).hasKey(key))
|
||||||
|
return ItemStack.loadItemStackFromNBT(getTagCompound(stack, key));
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void setLore(ItemStack stack, String... lore)
|
||||||
|
{
|
||||||
|
NBTTagCompound displayTag = getTagCompound(stack, "display");
|
||||||
|
NBTTagList list = new NBTTagList();
|
||||||
|
for(String s : lore)
|
||||||
|
list.appendTag(new NBTTagString(s));
|
||||||
|
displayTag.setTag("Lore", list);
|
||||||
|
setTagCompound(stack, "display", displayTag);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static int insertFluxItem(ItemStack container, int energy, int maxEnergy, boolean simulate)
|
||||||
|
{
|
||||||
|
int stored = getFluxStoredInItem(container);
|
||||||
|
int accepted = Math.min(energy, maxEnergy-stored);
|
||||||
|
if(!simulate)
|
||||||
|
{
|
||||||
|
stored += accepted;
|
||||||
|
ItemNBTHelper.setInt(container, "energy", stored);
|
||||||
|
}
|
||||||
|
return accepted;
|
||||||
|
}
|
||||||
|
public static int extractFluxFromItem(ItemStack container, int energy, boolean simulate)
|
||||||
|
{
|
||||||
|
int stored = getFluxStoredInItem(container);
|
||||||
|
int extracted = Math.min(energy, stored);
|
||||||
|
if(!simulate)
|
||||||
|
{
|
||||||
|
stored -= extracted;
|
||||||
|
ItemNBTHelper.setInt(container, "energy", stored);
|
||||||
|
}
|
||||||
|
return extracted;
|
||||||
|
}
|
||||||
|
public static int getFluxStoredInItem(ItemStack container)
|
||||||
|
{
|
||||||
|
return getInt(container, "energy");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static ItemStack stackWithData(ItemStack stack, Object... data)
|
||||||
|
{
|
||||||
|
assert(data.length%2==0);
|
||||||
|
for(int i=0; i<data.length/2; i++)
|
||||||
|
{
|
||||||
|
Object key = data[i];
|
||||||
|
Object value = data[i+1];
|
||||||
|
if(key instanceof String)
|
||||||
|
{
|
||||||
|
if(value instanceof Boolean)
|
||||||
|
setBoolean(stack, (String)key, (Boolean)value);
|
||||||
|
else if(value instanceof Integer)
|
||||||
|
setInt(stack, (String)key, (Integer)value);
|
||||||
|
else if(value instanceof Float)
|
||||||
|
setFloat(stack, (String)key, (Float)value);
|
||||||
|
else if(value instanceof Long)
|
||||||
|
setLong(stack, (String)key, (Long)value);
|
||||||
|
else if(value instanceof String)
|
||||||
|
setString(stack, (String)key, (String)value);
|
||||||
|
else if(value instanceof NBTTagCompound)
|
||||||
|
setTagCompound(stack, (String)key, (NBTTagCompound)value);
|
||||||
|
else if(value instanceof int[])
|
||||||
|
setIntArray(stack, (String)key, (int[])value);
|
||||||
|
else if(value instanceof ItemStack)
|
||||||
|
setItemStack(stack, (String)key, (ItemStack)value);
|
||||||
|
else if(value instanceof FluidStack)
|
||||||
|
setFluidStack(stack, (String)key, (FluidStack)value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return stack;
|
||||||
|
}
|
||||||
|
}
|
@ -1,14 +0,0 @@
|
|||||||
package fr.jackcartersmith.orbsat.item;
|
|
||||||
|
|
||||||
import fr.jackcartersmith.orbsat.OSRefs;
|
|
||||||
import fr.jackcartersmith.orbsat.OrbitalSatellite;
|
|
||||||
import net.minecraft.item.Item;
|
|
||||||
|
|
||||||
public class DesignatorCircuitItem extends Item{
|
|
||||||
public DesignatorCircuitItem(String unlocalizedName){
|
|
||||||
this.setUnlocalizedName(unlocalizedName);
|
|
||||||
this.setCreativeTab(OrbitalSatellite.creativeTab);
|
|
||||||
OrbitalSatellite.register(this, unlocalizedName);
|
|
||||||
OSRefs.registeredOSItems.add(this);
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,16 +0,0 @@
|
|||||||
package fr.jackcartersmith.orbsat.item;
|
|
||||||
|
|
||||||
import fr.jackcartersmith.orbsat.OSRefs;
|
|
||||||
import fr.jackcartersmith.orbsat.OrbitalSatellite;
|
|
||||||
import net.minecraft.item.Item;
|
|
||||||
|
|
||||||
public class LaserDesignatorItem extends Item {
|
|
||||||
|
|
||||||
public LaserDesignatorItem(String unlocalizedName){
|
|
||||||
this.setUnlocalizedName(unlocalizedName);
|
|
||||||
this.setMaxStackSize(1);
|
|
||||||
this.setCreativeTab(OrbitalSatellite.creativeTab);
|
|
||||||
OrbitalSatellite.register(this, unlocalizedName);
|
|
||||||
OSRefs.registeredOSItems.add(this);
|
|
||||||
}
|
|
||||||
}
|
|
@ -3,6 +3,9 @@ itemGroup.orbsat=Orbital Satellite
|
|||||||
#Items
|
#Items
|
||||||
item.orbsat.components.laserDesignator.name=Targeting Satellite Computer
|
item.orbsat.components.laserDesignator.name=Targeting Satellite Computer
|
||||||
item.orbsat.components.designatorCircuit.name=Targeting Computer Circuit
|
item.orbsat.components.designatorCircuit.name=Targeting Computer Circuit
|
||||||
|
item.orbsat.components.photonLens.name=Lens
|
||||||
|
item.orbsat.components.photonConcentrator.name=Photon Concentrator
|
||||||
|
item.orbsat.components.photonCapacitor.name=Photon Capacitor
|
||||||
item.orbsat.satellites.classic_mki.name=Classic Laser Satellite MK-I
|
item.orbsat.satellites.classic_mki.name=Classic Laser Satellite MK-I
|
||||||
item.orbsat.satellites.classic_mkii.name=Classic Laser Satellite MK-II
|
item.orbsat.satellites.classic_mkii.name=Classic Laser Satellite MK-II
|
||||||
item.orbsat.satellites.classic_mkiii.name=Classic Laser Satellite MK-III
|
item.orbsat.satellites.classic_mkiii.name=Classic Laser Satellite MK-III
|
@ -3,6 +3,9 @@ itemGroup.orbsat=Satellite Orbital
|
|||||||
#Items
|
#Items
|
||||||
item.orbsat.components.laserDesignator.name=Ordinateur de visée du satellite
|
item.orbsat.components.laserDesignator.name=Ordinateur de visée du satellite
|
||||||
item.orbsat.components.designatorCircuit.name=Circuit pour ordinateur de visée
|
item.orbsat.components.designatorCircuit.name=Circuit pour ordinateur de visée
|
||||||
|
item.orbsat.components.photonLens.name=Lentille
|
||||||
|
item.orbsat.components.photonConcentrator.name=Concentrateur à photon
|
||||||
|
item.orbsat.components.photonCapacitor.name=Condensateur à photon
|
||||||
item.orbsat.satellites.classic_mki.name=Satellite classique de frappe laser MK-I
|
item.orbsat.satellites.classic_mki.name=Satellite classique de frappe laser MK-I
|
||||||
item.orbsat.satellites.classic_mkii.name=Satellite classique de frappe laser MK-II
|
item.orbsat.satellites.classic_mkii.name=Satellite classique de frappe laser MK-II
|
||||||
item.orbsat.satellites.classic_mkiii.name=Satellite classique de frappe laser MK-III
|
item.orbsat.satellites.classic_mkiii.name=Satellite classique de frappe laser MK-III
|
@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"parent": "orbsat:item/flat",
|
||||||
|
"textures": {
|
||||||
|
"layer0": "orbsat:items/photonCapacitor"
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"parent": "orbsat:item/flat",
|
||||||
|
"textures": {
|
||||||
|
"layer0": "orbsat:items/photonConcentrator"
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"parent": "orbsat:item/flat",
|
||||||
|
"textures": {
|
||||||
|
"layer0": "orbsat:items/photonLens"
|
||||||
|
}
|
||||||
|
}
|
@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"parent": "item/generated",
|
"parent": "orbsat:item/flat",
|
||||||
"textures": {
|
"textures": {
|
||||||
"layer0": "orbsat:items/classicSatellite_mki"
|
"layer0": "orbsat:items/classicSatellite_mki"
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"parent":"orbsat:item/flat",
|
||||||
|
"textures": {
|
||||||
|
"layer0":"orbsat:items/railgun"
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,2 @@
|
|||||||
|
newmtl railgun
|
||||||
|
map_Ka orbsat:items/railgun
|
2902
src/main/resources/assets/orbsat/models/item/satellites/railgun.obj
Normal file
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 335 B After Width: | Height: | Size: 335 B |
Before Width: | Height: | Size: 254 B After Width: | Height: | Size: 254 B |
Before Width: | Height: | Size: 275 B After Width: | Height: | Size: 275 B |
BIN
src/main/resources/assets/orbsat/textures/items/railgun.png
Normal file
After Width: | Height: | Size: 5.1 KiB |
6
src/main/resources/pack.mcmeta
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"pack": {
|
||||||
|
"pack_format": 1,
|
||||||
|
"description": "Resources used for Orbital Satellite"
|
||||||
|
}
|
||||||
|
}
|