Added rubber items and production

This commit is contained in:
Unknown 2019-01-21 02:09:22 +01:00 committed by unknown
parent 729fb4d0f7
commit 697991f7fa
14 changed files with 119 additions and 29 deletions

View file

@ -25,8 +25,9 @@ import java.util.HashSet;
import java.util.LinkedList;
import net.minecraft.block.Block;
import net.minecraft.block.BlockOldLog;
import net.minecraft.block.BlockPlanks.EnumType;
import net.minecraft.block.state.IBlockState;
import net.minecraft.init.Blocks;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
@ -328,6 +329,40 @@ public class TileEntityLaserTreeFarm extends TileEntityAbstractMiner {
return;
}
}
// Jungle wood to raw rubber
if ( blockStateValuable.getBlock() instanceof BlockOldLog
&& blockStateValuable.getValue(BlockOldLog.VARIANT) == EnumType.JUNGLE ) {
if (WarpDriveConfig.LOGGING_COLLECTION) {
WarpDrive.logger.info(String.format("Tap found jungle wood at %s",
valuable));
}
// consume power
final int energyRequested = (int) Math.ceil(TREE_FARM_ENERGY_PER_LOG + TREE_FARM_ENERGY_PER_WET_SPOT);
isPowered = laserMedium_consumeExactly(energyRequested, false);
if (!isPowered) {
delayTargetTicks = TREE_FARM_LOW_POWER_DELAY_TICKS;
updateBlockState(blockState, BlockLaserTreeFarm.MODE, EnumLaserTreeFarmMode.FARMING_LOW_POWER);
return;
} else {
delayTargetTicks = TREE_FARM_TAP_TREE_WET_DELAY_TICKS;
updateBlockState(blockState, BlockLaserTreeFarm.MODE, EnumLaserTreeFarmMode.FARMING_POWERED);
}
final ItemStack itemStackRawRubber = ItemComponent.getItemStack(EnumComponentType.RAW_RUBBER);
if (InventoryWrapper.addToConnectedInventories(world, pos, itemStackRawRubber)) {
stop();
}
totalHarvested += itemStackRawRubber.getCount();
final int age = Math.max(10, Math.round((4 + world.rand.nextFloat()) * TREE_FARM_HARVEST_LOG_DELAY_TICKS));
PacketHandler.sendBeamPacket(world, laserOutput, new Vector3(valuable).translate(0.5D),
0.8F, 0.8F, 0.2F, age, 0, 50);
world.setBlockToAir(valuable);
// done with this block
return;
}
}
if (isLog || (breakLeaves && isLeaf)) {// actually break the block?

View file

@ -72,12 +72,15 @@ public class Recipes {
private static ItemStack[] itemStackMotors;
private static Object barsIron;
private static Object ingotIronOrSteel;
private static Object rubberOrLeather;
private static Object rubber;
private static Object goldNuggetOrBasicCircuit;
private static Object goldIngotOrAdvancedCircuit;
private static Object emeraldOrSuperiorCircuit;
public static void initOreDictionary() {
// components
registerOreDictionary("itemRubber", ItemComponent.getItemStack(EnumComponentType.RUBBER));
// air shields
for (final EnumDyeColor enumDyeColor : EnumDyeColor.values()) {
registerOreDictionary("blockAirShield", new ItemStack(WarpDrive.blockAirShield, 1, enumDyeColor.getMetadata()));
@ -213,11 +216,9 @@ public class Recipes {
"ore:ingotAluminum", 0,
"ore:ingotIron", 0);
// integrate with rubber and sealant from all mods
rubberOrLeather = WarpDriveConfig.getOreOrItemStack("ore:plateRubber", 0, // comes with GregTech
"ore:itemRubber", 0, // comes with IndustrialCraft2
"buildcrafttransport:waterproof", 0,
"ore:leather", 0);
// integrate with rubber from all mods
rubber = WarpDriveConfig.getOreOrItemStack("ore:plateRubber", 0, // comes with GregTech
"ore:itemRubber", 0 ); // comes with WarpDrive, IndustrialCraft2, IndustrialForegoing, TechReborn
// integrate with circuits from all mods
goldNuggetOrBasicCircuit = WarpDriveConfig.getOreOrItemStack("ore:circuitBasic", 0, // comes with IndustrialCraft2, Mekanism, VoltzEngine
@ -444,12 +445,12 @@ public class Recipes {
'w', itemStackWaterBottle,
'g', gunpowderOrSulfur));
// Air canister is 4 iron bars, 2 leather/rubber, 2 yellow wool, 1 tank
// Air canister is 4 iron bars, 2 rubber, 2 yellow wool, 1 tank
final Object woolPurple = WarpDriveConfig.getOreOrItemStack("ore:blockWoolPurple", 0,
"minecraft:wool", 10);
WarpDrive.register(new ShapedOreRecipe(groupComponents,
ItemComponent.getItemStackNoCache(EnumComponentType.AIR_CANISTER, 4), false, "iyi", "rgr", "iyi",
'r', rubberOrLeather,
'r', rubber,
'g', ItemComponent.getItemStack(EnumComponentType.GLASS_TANK),
'y', woolPurple,
'i', barsIron));
@ -489,13 +490,13 @@ public class Recipes {
'i', "ingotIron",
'n', "nuggetGold"));
// Pump is 2 Motor, 1 Iron ingot, 2 Tanks, 4 Rubber/leather, gives 2
// Pump is 2 Motor, 1 Iron ingot, 2 Tanks, 4 Rubber, gives 2
WarpDrive.register(new ShapedOreRecipe(groupComponents,
ItemComponent.getItemStackNoCache(EnumComponentType.PUMP, 2), false, "sst", "mim", "tss",
's', rubberOrLeather,
's', rubber,
'i', ingotIronOrSteel,
'm', itemStackMotors[0],
't', ItemComponent.getItemStack(EnumComponentType.GLASS_TANK)));
't', ItemComponent.getItemStack(EnumComponentType.GLASS_TANK) ));
// *** optical components
// Lens is 1 Diamond, 2 Gold ingots, 2 Glass panels
@ -545,11 +546,11 @@ public class Recipes {
'g', Blocks.GLOWSTONE));
// *** energy components
// Power interface is 4 Redstone, 2 Iron ingot, 3 Gold ingot
// Power interface is 4 Redstone, 2 Rubber, 3 Gold ingot
WarpDrive.register(new ShapedOreRecipe(groupComponents,
ItemComponent.getItemStackNoCache(EnumComponentType.POWER_INTERFACE, 3), false, "rgr", "RgR", "rgr",
'g', "ingotGold",
'R', rubberOrLeather,
'R', rubber,
'r', Items.REDSTONE ));
// Superconductor is 1 Ender crystal, 4 Power interface, 4 Cryotheum dust/Lapis block/10k Coolant cell
@ -595,6 +596,16 @@ public class Recipes {
'c', ItemComponent.getItemStack(EnumComponentType.CAPACITIVE_CRYSTAL),
'e', ItemComponent.getItemStack(EnumComponentType.EMERALD_CRYSTAL)));
}
// Raw rubber lump is produced from Jungle wood in the laser tree farm
// (no direct recipe)
// Rubber is the product of smelting (vulcanize) Raw rubber lump
// (in reality, vulcanization requires additives. This refining is optional, so low tiers could still use the Raw rubber lump)
GameRegistry.addSmelting(
ItemComponent.getItemStack(EnumComponentType.RAW_RUBBER),
ItemComponent.getItemStack(EnumComponentType.RUBBER),
0);
}
private static void initToolsAndArmor() {
@ -629,7 +640,7 @@ public class Recipes {
WarpDrive.itemWarpArmor[EntityEquipmentSlot.FEET.getIndex()], false, "wiw", "r r", " ",
'i', Items.IRON_BOOTS,
'w', Blocks.WOOL,
'r', rubberOrLeather));
'r', rubber ));
// Tuning fork variations
for (final EnumDyeColor enumDyeColor : EnumDyeColor.values()) {
@ -885,29 +896,29 @@ public class Recipes {
// Basic Air Tank is 2 Air canisters, 1 Pump, 1 Gold nugget, 1 Basic circuit, 4 Rubber
WarpDrive.register(new ShapedOreRecipe(groupTools,
WarpDrive.itemAirTanks[EnumAirTankTier.BASIC.getIndex()], false, "rnr", "tpt", "rcr",
'r', rubberOrLeather,
'r', rubber,
'p', ItemComponent.getItemStack(EnumComponentType.PUMP),
't', ItemComponent.getItemStack(EnumComponentType.AIR_CANISTER),
'c', goldNuggetOrBasicCircuit,
'n', "nuggetGold"));
'n', "nuggetGold" ));
// Advanced Air Tank is 2 Basic air tank, 1 Pump, 1 Gold nugget, 1 Advanced circuit, 4 Rubber
WarpDrive.register(new ShapedOreRecipe(groupTools,
WarpDrive.itemAirTanks[EnumAirTankTier.ADVANCED.getIndex()], false, "rnr", "tpt", "rcr",
'r', rubberOrLeather,
'r', rubber,
'p', itemStackMotors[1],
't', WarpDrive.itemAirTanks[EnumAirTankTier.BASIC.getIndex()],
'c', goldIngotOrAdvancedCircuit,
'n', "nuggetGold"));
'n', "nuggetGold" ));
// Superior Air Tank is 2 Advanced air tank, 1 Pump, 1 Gold nugget, 1 Elite circuit, 4 Rubber
WarpDrive.register(new ShapedOreRecipe(groupTools,
WarpDrive.itemAirTanks[EnumAirTankTier.SUPERIOR.getIndex()], false, "rnr", "tpt", "rcr",
'r', rubberOrLeather,
'r', rubber,
'p', itemStackMotors[2],
't', WarpDrive.itemAirTanks[EnumAirTankTier.ADVANCED.getIndex()],
'c', emeraldOrSuperiorCircuit,
'n', "nuggetGold"));
'n', "nuggetGold" ));
// Uncrafting air tanks and canister
WarpDrive.register(new ShapelessOreRecipe(groupComponents,
@ -1784,19 +1795,19 @@ public class Recipes {
// Laser camera is just Laser + Camera
WarpDrive.register(new ShapedOreRecipe(groupMachines,
new ItemStack(WarpDrive.blockLaserCamera), false, "rlr", "rsr", "rcr",
'r', rubberOrLeather,
'r', rubber,
's', goldNuggetOrBasicCircuit,
'l', WarpDrive.blockLaser,
'c', WarpDrive.blockCamera));
'c', WarpDrive.blockCamera ));
// Weapon controller is diamond sword with Ship controller
WarpDrive.register(new ShapedOreRecipe(groupMachines,
new ItemStack(WarpDrive.blockWeaponController), false, "rwr", "msm", "rcr",
'r', rubberOrLeather,
'r', rubber,
's', ItemComponent.getItemStack(EnumComponentType.EMERALD_CRYSTAL),
'm', ItemComponent.getItemStack(EnumComponentType.MEMORY_CRYSTAL),
'w', Items.DIAMOND_SWORD,
'c', WarpDrive.blockShipControllers[EnumTier.ADVANCED.getIndex()]));
'c', WarpDrive.blockShipControllers[EnumTier.ADVANCED.getIndex()] ));
}
/*

View file

@ -45,6 +45,10 @@ public enum EnumComponentType implements IStringSerializable {
LASER_MEDIUM_EMPTY ("laser_medium_empty"),
ELECTROMAGNETIC_PROJECTOR ("electromagnetic_projector"),
REACTOR_CORE ("reactor_core"),
// materials
RAW_RUBBER ("raw_rubber"),
RUBBER ("rubber"),
;
private final String name;

View file

@ -1,4 +1,4 @@

death.attack.warpdrive.asphyxia=%1$s ging die Luft aus
death.attack.warpdrive.asphyxia.player=%1$s wurde von %2$s erstickt
death.attack.warpdrive.cold=%1$s erfror
@ -50,6 +50,10 @@ item.warpdrive.component.laser_medium_empty.name=Medium Laser (leer)
item.warpdrive.component.electromagnetic_projector.name=Elektromagnetischer Projektor
item.warpdrive.component.reactor_core.name=Reaktorkern
item.warpdrive.component.raw_rubber.name=Raw rubber clump
item.warpdrive.component.raw_rubber.tooltip=Harvested from Jungle wood with Laser tree farm
item.warpdrive.component.rubber.name=Rubber
item.warpdrive.armor.helmet.name=Warp Helm
item.warpdrive.armor.chestplate.name=Warp Brustpanzer
item.warpdrive.armor.leggings.name=Warp Beinschutz

View file

@ -1,4 +1,4 @@

death.attack.warpdrive.asphyxia=%1$s died from asphyxia
death.attack.warpdrive.asphyxia.player=%1$s was killed by %2$s using asphyxia
death.attack.warpdrive.cold=%1$s died from cold
@ -50,6 +50,10 @@ item.warpdrive.component.laser_medium_empty.name=Laser Medium (empty)
item.warpdrive.component.electromagnetic_projector.name=Electromagnetic Projector
item.warpdrive.component.reactor_core.name=Reactor Core
item.warpdrive.component.raw_rubber.name=Raw rubber clump
item.warpdrive.component.raw_rubber.tooltip=Harvested from Jungle wood with Laser tree farm
item.warpdrive.component.rubber.name=Rubber
item.warpdrive.armor.helmet.name=Warp Helmet
item.warpdrive.armor.chestplate.name=Warp Chestplate
item.warpdrive.armor.leggings.name=Warp Leggings

View file

@ -1,4 +1,4 @@

death.attack.warpdrive.asphyxia=%1$s est mort asphyxié
death.attack.warpdrive.asphyxia.player=%1$s est mort asphyxié grace à %2$s
death.attack.warpdrive.cold=%1$s est mort de froid
@ -50,6 +50,10 @@ item.warpdrive.component.laser_medium_empty.name=Milieu amplificateur (vide)
item.warpdrive.component.electromagnetic_projector.name=Projecteur électromagnétique
item.warpdrive.component.reactor_core.name=Noyeau de réacteur
item.warpdrive.component.raw_rubber.name=Bloc de caoutchouc brut
item.warpdrive.component.raw_rubber.tooltip=Issue du bois d'acajou avec un laser forestier
item.warpdrive.component.rubber.name=Caoutchouc
item.warpdrive.armor.helmet.name=Casque warp
item.warpdrive.armor.chestplate.name=Plastron warp
item.warpdrive.armor.leggings.name=Jambières warp

View file

@ -50,6 +50,10 @@ item.warpdrive.component.laser_medium_empty.name=Lege Deeltjesversneller
item.warpdrive.component.electromagnetic_projector.name=Electromagnetische Projector
item.warpdrive.component.reactor_core.name=Reactor Kern
item.warpdrive.component.raw_rubber.name=Raw rubber clump
item.warpdrive.component.raw_rubber.tooltip=Harvested from Jungle wood with Laser tree farm
item.warpdrive.component.rubber.name=Rubber
item.warpdrive.armor.helmet.name=Warp Helm
item.warpdrive.armor.chestplate.name=Warp Borstplaat
item.warpdrive.armor.leggings.name=Warp Broek

View file

@ -1,4 +1,4 @@

death.attack.warpdrive.asphyxia=%1$s умер от удушья
death.attack.warpdrive.asphyxia.player=%2$s убил %1$s с помощью удушья
death.attack.warpdrive.cold=%1$s died from cold
@ -50,6 +50,10 @@ item.warpdrive.component.laser_medium_empty.name=Лазерный излучат
item.warpdrive.component.electromagnetic_projector.name=Electromagnetic Projector
item.warpdrive.component.reactor_core.name=Ядро реактора
item.warpdrive.component.raw_rubber.name=Raw rubber clump
item.warpdrive.component.raw_rubber.tooltip=Harvested from Jungle wood with Laser tree farm
item.warpdrive.component.rubber.name=Rubber
item.warpdrive.armor.helmet.name=Космический шлем
item.warpdrive.armor.chestplate.name=Warp Chestplate
item.warpdrive.armor.leggings.name=Warp Leggings

View file

@ -50,6 +50,10 @@ item.warpdrive.component.laser_medium_empty.name=激光媒质(空)
item.warpdrive.component.electromagnetic_projector.name=电磁投影仪
item.warpdrive.component.reactor_core.name=反应堆芯
item.warpdrive.component.raw_rubber.name=Raw rubber clump
item.warpdrive.component.raw_rubber.tooltip=Harvested from Jungle wood with Laser tree farm
item.warpdrive.component.rubber.name=Rubber
item.warpdrive.armor.helmet.name=曲率头盔
item.warpdrive.armor.chestplate.name=曲率胸甲
item.warpdrive.armor.leggings.name=曲率护腿

View file

@ -50,6 +50,10 @@ item.warpdrive.component.laser_medium_empty.name=激光觸媒 (空)
item.warpdrive.component.electromagnetic_projector.name=電磁投射器
item.warpdrive.component.reactor_core.name=反應核心
item.warpdrive.component.raw_rubber.name=Raw rubber clump
item.warpdrive.component.raw_rubber.tooltip=Harvested from Jungle wood with Laser tree farm
item.warpdrive.component.rubber.name=Rubber
item.warpdrive.armor.helmet.name=躍遷保護盔
item.warpdrive.armor.chestplate.name=Warp Chestplate
item.warpdrive.armor.leggings.name=Warp Leggings

View file

@ -0,0 +1,6 @@
{
"parent": "item/generated",
"textures": {
"layer0": "warpdrive:items/component/raw_rubber"
}
}

View file

@ -0,0 +1,6 @@
{
"parent": "item/generated",
"textures": {
"layer0": "warpdrive:items/component/rubber"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB