Fix Merges

This commit is contained in:
Stuart Pomeroy 2016-03-27 20:14:13 +01:00
commit dfb7d0afd4
26 changed files with 176 additions and 90 deletions

View file

@ -43,7 +43,7 @@ configurations {
compile.extendsFrom shade
}
version = "1.0.1"
version = "1.0.2"
def ENV = System.getenv()
if (ENV.BUILD_NUMBER) {

View file

@ -90,7 +90,8 @@ public class BlockMachineCasing extends BlockMultiblockBase implements ITextured
@Override
public int damageDropped(IBlockState state)
{
return super.damageDropped(state);
int meta = getMetaFromState(state);
return meta;
}
@Override
@ -122,5 +123,4 @@ public class BlockMachineCasing extends BlockMultiblockBase implements ITextured
{
return types.length;
}
}

View file

@ -58,7 +58,8 @@ public class BlockMachineFrame extends BaseBlock implements ITexturedBlock
@Override
public int damageDropped(IBlockState state)
{
return super.damageDropped(state);
int meta = getMetaFromState(state);
return meta;
}
@Override

View file

@ -5,7 +5,7 @@ import net.minecraft.world.World;
import techreborn.client.GuiHandler;
import techreborn.tiles.lesu.TileLesu;
public class BlockLESU extends BlockEnergyStorage
public class BlockLESU extends BlockEnergyStorage
{
public BlockLESU()
{
@ -17,5 +17,4 @@ public class BlockLESU extends BlockEnergyStorage
{
return new TileLesu();
}
}

View file

@ -1,7 +1,11 @@
package techreborn.blocks.storage;
import java.util.ArrayList;
import java.util.List;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
@ -44,6 +48,14 @@ public class BlockLESUStorage extends BlockMachineBase implements IAdvancedRotat
}
super.breakBlock(world, x, y, z, block, meta);
}
@Override
public List<ItemStack> getDrops(IBlockAccess world, BlockPos pos, IBlockState state, int fortune)
{
List<ItemStack> items = new ArrayList<ItemStack>();
items.add(new ItemStack(this));
return items;
}
@Override
public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_)

View file

@ -13,7 +13,7 @@ public class GuiDieselGenerator extends GuiContainer
{
private static final ResourceLocation texture = new ResourceLocation("techreborn",
"textures/gui/ThermalGenerator.png");
"textures/gui/diesel_generator.png");
TileDieselGenerator tile;

View file

@ -13,7 +13,7 @@ public class GuiSemifluidGenerator extends GuiContainer
// TODO: use semifluid generator texture
private static final ResourceLocation texture = new ResourceLocation("techreborn",
"textures/gui/ThermalGenerator.png");
"textures/gui/semifluid_generator.png");
TileSemifluidGenerator tile;

View file

@ -19,6 +19,7 @@ import techreborn.api.reactor.FusionReactorRecipeHelper;
import techreborn.api.recipe.RecipeHandler;
import techreborn.api.recipe.machines.AssemblingMachineRecipe;
import techreborn.api.recipe.machines.ImplosionCompressorRecipe;
import techreborn.blocks.fluid.BlockFluidTechReborn;
import techreborn.client.container.ContainerAlloyFurnace;
import techreborn.client.container.ContainerAlloySmelter;
import techreborn.client.container.ContainerAssemblingMachine;
@ -90,6 +91,7 @@ import techreborn.compat.jei.scrapbox.ScrapboxRecipeHandler;
import techreborn.compat.jei.vacuumFreezer.VacuumFreezerRecipeCategory;
import techreborn.compat.jei.vacuumFreezer.VacuumFreezerRecipeHandler;
import techreborn.config.ConfigTechReborn;
import techreborn.init.ModFluids;
import techreborn.init.ModItems;
import techreborn.items.ItemParts;
@ -124,6 +126,30 @@ public class TechRebornJeiPlugin extends BlankModPlugin
IJeiHelpers jeiHelpers = registry.getJeiHelpers();
IGuiHelper guiHelper = jeiHelpers.getGuiHelper();
jeiHelpers.getItemBlacklist().addItemToBlacklist(new ItemStack(ModFluids.BlockFluidBerylium));
jeiHelpers.getItemBlacklist().addItemToBlacklist(new ItemStack(ModFluids.BlockFluidCalcium));
jeiHelpers.getItemBlacklist().addItemToBlacklist(new ItemStack(ModFluids.BlockFluidCalciumCarbonate));
jeiHelpers.getItemBlacklist().addItemToBlacklist(new ItemStack(ModFluids.BlockFluidChlorite));
jeiHelpers.getItemBlacklist().addItemToBlacklist(new ItemStack(ModFluids.BlockFluidDeuterium));
jeiHelpers.getItemBlacklist().addItemToBlacklist(new ItemStack(ModFluids.BlockFluidGlyceryl));
jeiHelpers.getItemBlacklist().addItemToBlacklist(new ItemStack(ModFluids.BlockFluidHelium));
jeiHelpers.getItemBlacklist().addItemToBlacklist(new ItemStack(ModFluids.BlockFluidHelium3));
jeiHelpers.getItemBlacklist().addItemToBlacklist(new ItemStack(ModFluids.BlockFluidHeliumplasma));
jeiHelpers.getItemBlacklist().addItemToBlacklist(new ItemStack(ModFluids.BlockFluidHydrogen));
jeiHelpers.getItemBlacklist().addItemToBlacklist(new ItemStack(ModFluids.BlockFluidLithium));
jeiHelpers.getItemBlacklist().addItemToBlacklist(new ItemStack(ModFluids.BlockFluidMercury));
jeiHelpers.getItemBlacklist().addItemToBlacklist(new ItemStack(ModFluids.BlockFluidMethane));
jeiHelpers.getItemBlacklist().addItemToBlacklist(new ItemStack(ModFluids.BlockFluidNitrocoalfuel));
jeiHelpers.getItemBlacklist().addItemToBlacklist(new ItemStack(ModFluids.BlockFluidNitrofuel));
jeiHelpers.getItemBlacklist().addItemToBlacklist(new ItemStack(ModFluids.BlockFluidNitrogen));
jeiHelpers.getItemBlacklist().addItemToBlacklist(new ItemStack(ModFluids.BlockFluidNitrogendioxide));
jeiHelpers.getItemBlacklist().addItemToBlacklist(new ItemStack(ModFluids.BlockFluidPotassium));
jeiHelpers.getItemBlacklist().addItemToBlacklist(new ItemStack(ModFluids.BlockFluidSilicon));
jeiHelpers.getItemBlacklist().addItemToBlacklist(new ItemStack(ModFluids.BlockFluidSodium));
jeiHelpers.getItemBlacklist().addItemToBlacklist(new ItemStack(ModFluids.BlockFluidSodiumpersulfate));
jeiHelpers.getItemBlacklist().addItemToBlacklist(new ItemStack(ModFluids.BlockFluidTritium));
jeiHelpers.getItemBlacklist().addItemToBlacklist(new ItemStack(ModFluids.BlockFluidWolframium));
registry.addRecipeCategories(new AlloySmelterRecipeCategory(guiHelper),
new AssemblingMachineRecipeCategory(guiHelper), new BlastFurnaceRecipeCategory(guiHelper),
new CentrifugeRecipeCategory(guiHelper), new ChemicalReactorRecipeCategory(guiHelper),

View file

@ -1,11 +1,14 @@
package techreborn.items.tools;
import java.util.List;
import me.modmuss50.jsonDestroyer.api.ITexturedItem;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ActionResult;
import net.minecraft.util.EnumActionResult;
import net.minecraft.util.EnumHand;
import net.minecraft.util.text.TextFormatting;
import net.minecraft.world.World;
import techreborn.Core;
import techreborn.client.GuiHandler;
@ -42,5 +45,10 @@ public class ItemTechManual extends ItemTextureBase implements ITexturedItem
{
return "techreborn:items/tool/manual";
}
@Override
public void addInformation(ItemStack stack, EntityPlayer playerIn, List<String> tooltip, boolean advanced)
{
tooltip.add(TextFormatting.RED + "WIP Coming Soon");
}
}

View file

@ -21,13 +21,15 @@ import net.minecraft.world.World;
import net.minecraftforge.fluids.BlockFluidBase;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import reborncore.common.tile.TileMachineBase;
import techreborn.blocks.storage.BlockBatBox;
import techreborn.client.TechRebornCreativeTabMisc;
import techreborn.items.ItemTR;
import techreborn.lib.ModInfo;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
import techreborn.tiles.storage.TileBatBox;
/**
* Created by modmuss50 on 26/02/2016.
@ -43,10 +45,8 @@ public class ItemWrench extends ItemTR implements ITexturedItem
}
@Override
public EnumActionResult onItemUse(ItemStack stack, EntityPlayer player, World world, BlockPos pos, EnumHand hand,
EnumFacing facing, float hitX, float hitY, float hitZ)
{
if (world.isAirBlock(pos) || !player.isSneaking())
public EnumActionResult onItemUseFirst(ItemStack stack, EntityPlayer player, World world, BlockPos pos, EnumFacing side, float hitX, float hitY, float hitZ, EnumHand hand) {
if (world.isAirBlock(pos))
{
return EnumActionResult.FAIL;
}
@ -55,80 +55,117 @@ public class ItemWrench extends ItemTR implements ITexturedItem
{
return EnumActionResult.FAIL;
}
if (!(tile instanceof IInventory))
if(!player.isSneaking()){
if(tile instanceof TileBatBox){
tile.getWorld().setBlockState(tile.getPos(), tile.getWorld().getBlockState(pos).withProperty(BlockBatBox.FACING, side.getOpposite()));
return EnumActionResult.SUCCESS;
} else
if(tile instanceof TileMachineBase){
if(side != EnumFacing.DOWN && side != EnumFacing.UP){
((TileMachineBase) tile).setFacing(side);
return EnumActionResult.SUCCESS;
}
}
}
return super.onItemUseFirst(stack, player, world, pos, side, hitX, hitY, hitZ, hand);
}
@Override
public EnumActionResult onItemUse(ItemStack stack, EntityPlayer player, World world, BlockPos pos, EnumHand hand,
EnumFacing facing, float hitX, float hitY, float hitZ)
{
if (world.isAirBlock(pos))
{
return EnumActionResult.FAIL;
}
TileEntity tile = world.getTileEntity(pos);
if (tile == null)
{
return EnumActionResult.FAIL;
}
List<ItemStack> items = new ArrayList<ItemStack>();
IInventory inventory = (IInventory) tile;
for (int i = 0; i < inventory.getSizeInventory(); i++)
if (player.isSneaking())
{
ItemStack itemStack = inventory.getStackInSlot(i);
if (itemStack == null)
List<ItemStack> items = new ArrayList<ItemStack>();
if (tile instanceof IInventory)
{
continue;
}
if (itemStack != null && itemStack.stackSize > 0)
{
if (itemStack.getItem() instanceof ItemBlock)
IInventory inventory = (IInventory) tile;
for (int i = 0; i < inventory.getSizeInventory(); i++)
{
if (((ItemBlock) itemStack.getItem()).block instanceof BlockFluidBase
|| ((ItemBlock) itemStack.getItem()).block instanceof BlockStaticLiquid
|| ((ItemBlock) itemStack.getItem()).block instanceof BlockDynamicLiquid)
ItemStack itemStack = inventory.getStackInSlot(i);
if (itemStack == null)
{
continue;
}
if (itemStack != null && itemStack.stackSize > 0)
{
if (itemStack.getItem() instanceof ItemBlock)
{
if (((ItemBlock) itemStack.getItem()).block instanceof BlockFluidBase
|| ((ItemBlock) itemStack.getItem()).block instanceof BlockStaticLiquid
|| ((ItemBlock) itemStack.getItem()).block instanceof BlockDynamicLiquid)
{
continue;
}
}
}
items.add(itemStack.copy());
}
}
items.add(itemStack.copy());
}
if (tile instanceof IWrenchable)
{
if (((IWrenchable) tile).wrenchCanRemove(player))
if (tile instanceof IWrenchable)
{
ItemStack itemStack = ((IWrenchable) tile).getWrenchDrop(player);
if (itemStack == null)
if (((IWrenchable) tile).wrenchCanRemove(player))
{
return EnumActionResult.FAIL;
ItemStack itemStack = ((IWrenchable) tile).getWrenchDrop(player);
if (itemStack == null)
{
return EnumActionResult.FAIL;
}
items.add(itemStack);
}
items.add(itemStack);
}
for (ItemStack itemStack : items)
{
Random rand = new Random();
float dX = rand.nextFloat() * 0.8F + 0.1F;
float dY = rand.nextFloat() * 0.8F + 0.1F;
float dZ = rand.nextFloat() * 0.8F + 0.1F;
EntityItem entityItem = new EntityItem(world, pos.getX() + dX, pos.getY() + dY, pos.getZ() + dZ,
itemStack.copy());
if (itemStack.hasTagCompound())
if (!items.isEmpty())
{
entityItem.getEntityItem().setTagCompound((NBTTagCompound) itemStack.getTagCompound().copy());
for (ItemStack itemStack : items)
{
Random rand = new Random();
float dX = rand.nextFloat() * 0.8F + 0.1F;
float dY = rand.nextFloat() * 0.8F + 0.1F;
float dZ = rand.nextFloat() * 0.8F + 0.1F;
EntityItem entityItem = new EntityItem(world, pos.getX() + dX, pos.getY() + dY, pos.getZ() + dZ,
itemStack.copy());
if (itemStack.hasTagCompound())
{
entityItem.getEntityItem()
.setTagCompound((NBTTagCompound) itemStack.getTagCompound().copy());
}
float factor = 0.05F;
entityItem.motionX = rand.nextGaussian() * factor;
entityItem.motionY = rand.nextGaussian() * factor + 0.2F;
entityItem.motionZ = rand.nextGaussian() * factor;
if (!world.isRemote)
{
world.spawnEntityInWorld(entityItem);
}
}
}
float factor = 0.05F;
entityItem.motionX = rand.nextGaussian() * factor;
entityItem.motionY = rand.nextGaussian() * factor + 0.2F;
entityItem.motionZ = rand.nextGaussian() * factor;
// TODO 1.9 sounds
// world.playSoundAtEntity(player, "techreborn:block_dismantle",
// 0.8F, 1F);
if (!world.isRemote)
{
world.spawnEntityInWorld(entityItem);
world.setBlockState(pos, Blocks.air.getDefaultState(), 2);
}
return EnumActionResult.SUCCESS;
}
// TODO 1.9 sounds
// world.playSoundAtEntity(player, "techreborn:block_dismantle",
// 0.8F, 1F);
if (!world.isRemote)
{
world.setBlockState(pos, Blocks.air.getDefaultState(), 2);
}
return EnumActionResult.SUCCESS;
}
return EnumActionResult.FAIL;
}

View file

@ -383,7 +383,6 @@ public class MultiBlockCasing extends RectangularMultiblockControllerBase
protected void isBlockGoodForFrame(World world, int x, int y, int z) throws MultiblockValidationException
{
Block block = world.getBlockState(new BlockPos(x, y, z)).getBlock();
world.setBlockState(new BlockPos(x, y, z), Blocks.bedrock.getDefaultState(), 3);
if (block == ModBlocks.MachineCasing)
{

View file

@ -399,8 +399,8 @@ public abstract class CableMultipart extends Multipart
}
if (ConfigTechReborn.UninsulatedElectocutionSound)
{
getWorld().playSound(entity.posX, entity.posY, entity.posZ, ModSounds.shock,
SoundCategory.BLOCKS, 0.6F, 1F, false);
// getWorld().playSound(entity.posX, entity.posY, entity.posZ, ModSounds.shock,
// SoundCategory.BLOCKS, 0.6F, 1F, false);
}
if (ConfigTechReborn.UninsulatedElectocutionParticle)
{

View file

@ -13,22 +13,14 @@ import techreborn.parts.types.TinCable;
public enum EnumCableType implements IStringSerializable
{
COPPER("copper", "techreborn:blocks/cables/copper_cable", 128, 12.0, true, EnumPowerTier.LOW,
CopperCable.class), TIN("tin", "techreborn:blocks/cables/tin_cable", 32, 12.0, true, EnumPowerTier.MEDIUM,
TinCable.class), GOLD("gold", "techreborn:blocks/cables/gold_cable", 512, 12.0, true,
EnumPowerTier.MEDIUM, GoldCable.class), HV("hv", "techreborn:blocks/cables/hv_cable", 2048,
12.0, true, EnumPowerTier.HIGH, HVCable.class), GLASSFIBER("glassfiber",
"techreborn:blocks/cables/glass_fiber_cable", 8192, 12.0, false,
EnumPowerTier.HIGH, GlassFiberCable.class), ICOPPER("insulatedcopper",
"techreborn:blocks/cables/copper_insulated_cable", 128, 10.0, false,
EnumPowerTier.LOW,
InsulatedCopperCable.class), IGOLD("insulatedgold",
"techreborn:blocks/cables/gold_insulated_cable", 512, 10.0,
false, EnumPowerTier.MEDIUM,
InsulatedGoldCable.class), IHV("insulatedhv",
"techreborn:blocks/cables/hv_insulated_cable", 2048,
10.0, false, EnumPowerTier.HIGH,
InsulatedHVCable.class);
COPPER("copper", "techreborn:blocks/cables/copper_cable", 128, 12.0, true, EnumPowerTier.LOW, CopperCable.class),
TIN("tin", "techreborn:blocks/cables/tin_cable", 32, 12.0, true, EnumPowerTier.MEDIUM, TinCable.class),
GOLD("gold", "techreborn:blocks/cables/gold_cable", 512, 12.0, true, EnumPowerTier.MEDIUM, GoldCable.class),
HV("hv", "techreborn:blocks/cables/hv_cable", 2048, 12.0, true, EnumPowerTier.HIGH, HVCable.class),
GLASSFIBER("glassfiber", "techreborn:blocks/cables/glass_fiber_cable", 8192, 12.0, false, EnumPowerTier.HIGH, GlassFiberCable.class),
ICOPPER("insulatedcopper", "techreborn:blocks/cables/copper_insulated_cable", 128, 10.0, false, EnumPowerTier.LOW, InsulatedCopperCable.class),
IGOLD("insulatedgold", "techreborn:blocks/cables/gold_insulated_cable", 512, 10.0, false, EnumPowerTier.MEDIUM, InsulatedGoldCable.class),
IHV("insulatedhv", "techreborn:blocks/cables/hv_insulated_cable", 2048, 10.0, false, EnumPowerTier.HIGH, InsulatedHVCable.class);
public String textureName = "minecraft:blocks/iron_block";
public int transferRate = 128;

View file

@ -14,6 +14,7 @@ import net.minecraft.util.EnumFacing;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Vec3d;
import net.minecraft.util.text.TextFormatting;
import net.minecraft.util.text.translation.I18n;
import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@ -96,11 +97,11 @@ public class ItemCables extends ItemMultiPart implements ITexturedItem
public void addInformation(ItemStack stack, EntityPlayer playerIn, List<String> tooltip, boolean advanced)
{
EnumCableType type = EnumCableType.values()[stack.getItemDamage()];
tooltip.add(TextFormatting.GREEN + "EU Transfer: " + TextFormatting.LIGHT_PURPLE + type.transferRate);
tooltip.add(TextFormatting.GREEN + I18n.translateToLocal("desc.euTransfer") + TextFormatting.LIGHT_PURPLE + type.transferRate);
if (type.canKill)
{
tooltip.add(TextFormatting.RED + "Damages entity's!");
tooltip.add(TextFormatting.RED + I18n.translateToLocal("desc.uninsulatedCable"));
}
tooltip.add(TextFormatting.GREEN + "Tier: " + TextFormatting.LIGHT_PURPLE + type.tier);
tooltip.add(TextFormatting.GREEN + I18n.translateToLocal("desc.tier") + TextFormatting.LIGHT_PURPLE + type.tier);
}
}

View file

@ -11,6 +11,6 @@ public class TinCable extends CableMultipart
@Override
public EnumCableType getCableType()
{
return EnumCableType.COPPER;
return EnumCableType.TIN;
}
}

View file

@ -13,6 +13,8 @@ import reborncore.common.util.Inventory;
import reborncore.common.util.ItemUtils;
import techreborn.init.ModBlocks;
import techreborn.init.ModItems;
import ic2.api.tile.IWrenchable;
import techreborn.items.ItemParts;
public class TileMatterFabricator extends TilePowerAcceptor implements IWrenchable, IInventory
{
@ -302,6 +304,11 @@ public class TileMatterFabricator extends TilePowerAcceptor implements IWrenchab
{
// int value = getValue(Recipes.matterAmplifier.getOutputFor(itemStack,
// false));
if(itemStack.getItem() == ModItems.parts && itemStack.getItemDamage() == ItemParts.getPartByName("scrap").getItemDamage()){
return 5000;
} else if (itemStack.getItem() == ModItems.scrapBox){
return 45000;
}
return 0;
}

View file

@ -81,7 +81,7 @@ public class TileQuantumTank extends TileMachineBase
FluidUtils.fillContainers(this, inventory, 0, 1, tank.getFluidType());
if (tank.getFluidType() != null && getStackInSlot(2) == null)
{
inventory.setInventorySlotContents(2, new ItemStack(tank.getFluidType().getBlock()));
// inventory.setInventorySlotContents(2, new ItemStack(tank.getFluidType().getBlock()));
} else if (tank.getFluidType() == null && getStackInSlot(2) != null)
{
setInventorySlotContents(2, null);

View file

@ -158,9 +158,9 @@ public class TileThermalGenerator extends TilePowerAcceptor implements IWrenchab
public void updateEntity()
{
super.updateEntity();
FluidUtils.drainContainers(this, inventory, 0, 1);
if (!worldObj.isRemote)
{
FluidUtils.drainContainers(this, inventory, 0, 1);
for (EnumFacing direction : EnumFacing.values())
{
if (worldObj.getBlockState(new BlockPos(getPos().getX() + direction.getFrontOffsetX(),

View file

@ -958,6 +958,10 @@ Cable.trippleInsulatedIronCable.name=Triple Insulated Copper Cable
Cable.glassFiberCable.name=Glass Fiber Cable
Cable.tinCable.name=Tin Cable
desc.uninsulatedCable=Damages Entities!
desc.euTransfer=EU Transfer:
desc.tier=Tier:
#Manual
techreborn.manual.contents=Contents Page
techreborn.manual.gettingstarted=Getting Started

Binary file not shown.

Before

Width:  |  Height:  |  Size: 503 B

After

Width:  |  Height:  |  Size: 490 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 441 B

After

Width:  |  Height:  |  Size: 428 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 694 B

After

Width:  |  Height:  |  Size: 681 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 460 B

After

Width:  |  Height:  |  Size: 597 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 382 B

After

Width:  |  Height:  |  Size: 499 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB