This commit is contained in:
parent
877691403d
commit
8ceebae43f
44
build.gradle
44
build.gradle
|
@ -16,8 +16,12 @@ buildscript {
|
||||||
}
|
}
|
||||||
|
|
||||||
apply plugin: 'forge'
|
apply plugin: 'forge'
|
||||||
|
apply plugin: 'maven-publish'
|
||||||
|
|
||||||
version = "1.0.0-dirty"
|
sourceCompatibility = JavaVersion.VERSION_1_8
|
||||||
|
targetCompatibility = JavaVersion.VERSION_1_8
|
||||||
|
|
||||||
|
version = "1.0.1-dirty"
|
||||||
group= "universalelectricity"
|
group= "universalelectricity"
|
||||||
archivesBaseName = "basiccomponents"
|
archivesBaseName = "basiccomponents"
|
||||||
|
|
||||||
|
@ -45,3 +49,41 @@ processResources
|
||||||
exclude 'mcmod.info'
|
exclude 'mcmod.info'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
task deobfJar(type: Jar) {
|
||||||
|
from sourceSets.main.output
|
||||||
|
classifier = 'deobf'
|
||||||
|
}
|
||||||
|
|
||||||
|
task sourcesJar(type: Jar) {
|
||||||
|
from sourceSets.main.allSource
|
||||||
|
classifier = 'sources'
|
||||||
|
}
|
||||||
|
|
||||||
|
publishing {
|
||||||
|
tasks.publish.dependsOn 'build'
|
||||||
|
publications {
|
||||||
|
mavenJava(MavenPublication) {
|
||||||
|
artifactId = project.archivesBaseName
|
||||||
|
|
||||||
|
artifact deobfJar
|
||||||
|
artifact sourcesJar
|
||||||
|
artifact jar
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
repositories {
|
||||||
|
if (project.hasProperty('mvnURL')) {
|
||||||
|
maven {
|
||||||
|
credentials {
|
||||||
|
username findProperty("mvnUsername")
|
||||||
|
password findProperty("mvnPassword")
|
||||||
|
}
|
||||||
|
url = findProperty("mvnURL")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
mavenLocal()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -3,6 +3,7 @@ package basiccomponents.common.item;
|
||||||
import basiccomponents.common.item.ItemBase;
|
import basiccomponents.common.item.ItemBase;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import net.minecraft.creativetab.CreativeTabs;
|
import net.minecraft.creativetab.CreativeTabs;
|
||||||
|
import net.minecraft.item.Item;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
|
|
||||||
public class ItemCircuit extends ItemBase {
|
public class ItemCircuit extends ItemBase {
|
||||||
|
@ -24,7 +25,8 @@ public class ItemCircuit extends ItemBase {
|
||||||
return "item.basiccomponents:" + TYPES[itemStack.getItemDamage()];
|
return "item.basiccomponents:" + TYPES[itemStack.getItemDamage()];
|
||||||
}
|
}
|
||||||
|
|
||||||
public void func_77633_a(int par1, CreativeTabs par2CreativeTabs, List list) {
|
@Override
|
||||||
|
public void getSubItems(Item par1, CreativeTabs par2CreativeTabs, List list) {
|
||||||
for(int i = 0; i < TYPES.length; ++i) {
|
for(int i = 0; i < TYPES.length; ++i) {
|
||||||
list.add(new ItemStack(this, 1, i));
|
list.add(new ItemStack(this, 1, i));
|
||||||
}
|
}
|
||||||
|
|
|
@ -84,7 +84,8 @@ public abstract class ItemElectric extends Item implements IItemElectric {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void func_77633_a(int par1, CreativeTabs par2CreativeTabs, List par3List) {
|
@Override
|
||||||
|
public void getSubItems(Item par1, CreativeTabs par2CreativeTabs, List par3List) {
|
||||||
par3List.add(ElectricItemHelper.getUncharged(new ItemStack(this)));
|
par3List.add(ElectricItemHelper.getUncharged(new ItemStack(this)));
|
||||||
ItemStack chargedItem = new ItemStack(this);
|
ItemStack chargedItem = new ItemStack(this);
|
||||||
par3List.add(ElectricItemHelper.getWithCharge(chargedItem, this.getMaxJoules(chargedItem)));
|
par3List.add(ElectricItemHelper.getWithCharge(chargedItem, this.getMaxJoules(chargedItem)));
|
||||||
|
|
|
@ -104,11 +104,6 @@ public abstract class BlockAdvanced extends BlockContainer {
|
||||||
return this.onUseWrench(world, x, y, z, entityPlayer, side, hitX, hitY, hitZ);
|
return this.onUseWrench(world, x, y, z, entityPlayer, side, hitX, hitY, hitZ);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public TileEntity createTileEntity(World var1, int meta) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void breakBlock(World world, int x, int y, int z, Block par5, int par6) {
|
public void breakBlock(World world, int x, int y, int z, Block par5, int par6) {
|
||||||
this.dropEntireInventory(world, x, y, z, par5, par6);
|
this.dropEntireInventory(world, x, y, z, par5, par6);
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
package universalelectricity.prefab.block;
|
package universalelectricity.prefab.block;
|
||||||
|
|
||||||
import net.minecraft.block.material.Material;
|
import net.minecraft.block.material.Material;
|
||||||
import net.minecraft.entity.EntityLiving;
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.util.MathHelper;
|
import net.minecraft.util.MathHelper;
|
||||||
|
@ -16,7 +16,8 @@ public abstract class BlockRotatable extends BlockAdvanced implements IRotatable
|
||||||
super(material);
|
super(material);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void func_71860_a(World world, int x, int y, int z, EntityLiving entityLiving, ItemStack itemStack) {
|
@Override
|
||||||
|
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase entityLiving, ItemStack itemStack) {
|
||||||
int angle = MathHelper.floor_double((double)(entityLiving.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3;
|
int angle = MathHelper.floor_double((double)(entityLiving.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3;
|
||||||
byte change = 3;
|
byte change = 3;
|
||||||
switch(angle) {
|
switch(angle) {
|
||||||
|
|
|
@ -24,8 +24,7 @@ public class BlockMulti extends BlockContainer {
|
||||||
public BlockMulti() {
|
public BlockMulti() {
|
||||||
super(UniversalElectricity.machine);
|
super(UniversalElectricity.machine);
|
||||||
this.setHardness(0.8F);
|
this.setHardness(0.8F);
|
||||||
//TODO WTF
|
this.setBlockName("multiBlock");
|
||||||
//this.setUnlocalizedName("multiBlock");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public BlockMulti setChannel(String channel) {
|
public BlockMulti setChannel(String channel) {
|
||||||
|
|
|
@ -1,17 +1,13 @@
|
||||||
package universalelectricity.prefab.multiblock;
|
package universalelectricity.prefab.multiblock;
|
||||||
|
|
||||||
import com.google.common.io.ByteArrayDataInput;
|
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
import net.minecraft.network.NetworkManager;
|
import net.minecraft.network.NetworkManager;
|
||||||
import net.minecraft.network.Packet;
|
import net.minecraft.network.Packet;
|
||||||
import net.minecraft.network.play.server.S35PacketUpdateTileEntity;
|
import net.minecraft.network.play.server.S35PacketUpdateTileEntity;
|
||||||
import net.minecraft.network.play.server.S3FPacketCustomPayload;
|
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import universalelectricity.core.vector.Vector3;
|
import universalelectricity.core.vector.Vector3;
|
||||||
import universalelectricity.prefab.multiblock.BlockMulti;
|
|
||||||
import universalelectricity.prefab.multiblock.IMultiBlock;
|
|
||||||
|
|
||||||
public class TileEntityMulti extends TileEntity {
|
public class TileEntityMulti extends TileEntity {
|
||||||
|
|
||||||
|
@ -33,18 +29,15 @@ public class TileEntityMulti extends TileEntity {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*@Override
|
@Override
|
||||||
public Packet getDescriptionPacket() {
|
public Packet getDescriptionPacket() {
|
||||||
if(this.mainBlockPosition == null) {
|
if(this.mainBlockPosition == null) {
|
||||||
return null;
|
return null;
|
||||||
} else {
|
} else {
|
||||||
if(this.channel == null || this.channel == "" && this.getBlockType() instanceof BlockMulti) {
|
NBTTagCompound nbt = this.mainBlockPosition.writeToNBT(new NBTTagCompound());
|
||||||
this.channel = ((BlockMulti)this.getBlockType()).channel;
|
return new S35PacketUpdateTileEntity(xCoord, yCoord, zCoord, getBlockMetadata(),nbt);
|
||||||
}
|
|
||||||
|
|
||||||
return PacketManager.getPacket(this.channel, this, new Object[]{Integer.valueOf(this.mainBlockPosition.intX()), Integer.valueOf(this.mainBlockPosition.intY()), Integer.valueOf(this.mainBlockPosition.intZ())});
|
|
||||||
}
|
}
|
||||||
}*/
|
}
|
||||||
|
|
||||||
public void onBlockRemoval() {
|
public void onBlockRemoval() {
|
||||||
if(this.mainBlockPosition != null) {
|
if(this.mainBlockPosition != null) {
|
||||||
|
@ -89,18 +82,10 @@ public class TileEntityMulti extends TileEntity {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*@Override
|
|
||||||
public void handlePacketData(NetworkManager network, int packetType, S3FPacketCustomPayload packet, EntityPlayer player, ByteArrayDataInput dataStream) {
|
|
||||||
try {
|
|
||||||
this.mainBlockPosition = new Vector3((double)dataStream.readInt(), (double)dataStream.readInt(), (double)dataStream.readInt());
|
|
||||||
} catch (Exception var7) {
|
|
||||||
var7.printStackTrace();
|
|
||||||
}
|
|
||||||
}*/
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity pkt) {
|
public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity pkt) {
|
||||||
|
NBTTagCompound nbt = pkt.func_148857_g();
|
||||||
|
this.mainBlockPosition = Vector3.readFromNBT(nbt);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue