Merge remote-tracking branch 'remotes/origin/1.10.2-v1' into 1.11 #betabuild
# Conflicts: # build.gradle # src/main/java/techreborn/client/container/ContainerAlloyFurnace.java # src/main/java/techreborn/items/tools/ItemWrench.java
This commit is contained in:
commit
3f8128d890
7 changed files with 73 additions and 23 deletions
|
@ -2,12 +2,23 @@ package techreborn.client.container;
|
||||||
|
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.inventory.IContainerListener;
|
import net.minecraft.inventory.IContainerListener;
|
||||||
|
import net.minecraft.inventory.IInventory;
|
||||||
import net.minecraft.inventory.SlotFurnaceFuel;
|
import net.minecraft.inventory.SlotFurnaceFuel;
|
||||||
import reborncore.client.gui.slots.BaseSlot;
|
import reborncore.client.gui.slots.BaseSlot;
|
||||||
import reborncore.client.gui.slots.SlotOutput;
|
import reborncore.client.gui.slots.SlotOutput;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import reborncore.api.recipe.IBaseRecipeType;
|
||||||
|
import reborncore.api.recipe.RecipeHandler;
|
||||||
|
import reborncore.client.gui.BaseSlot;
|
||||||
|
import reborncore.client.gui.SlotOutput;
|
||||||
import reborncore.common.container.RebornContainer;
|
import reborncore.common.container.RebornContainer;
|
||||||
|
import reborncore.common.util.ItemUtils;
|
||||||
|
import techreborn.api.recipe.machines.AlloySmelterRecipe;
|
||||||
|
import techreborn.api.recipe.recipeConfig.RecipeConfigManager;
|
||||||
import techreborn.tiles.TileAlloyFurnace;
|
import techreborn.tiles.TileAlloyFurnace;
|
||||||
|
|
||||||
|
import javax.annotation.Nullable;
|
||||||
|
|
||||||
public class ContainerAlloyFurnace extends RebornContainer {
|
public class ContainerAlloyFurnace extends RebornContainer {
|
||||||
|
|
||||||
public int tickTime;
|
public int tickTime;
|
||||||
|
@ -22,8 +33,8 @@ public class ContainerAlloyFurnace extends RebornContainer {
|
||||||
this.player = player;
|
this.player = player;
|
||||||
|
|
||||||
// input
|
// input
|
||||||
this.addSlotToContainer(new BaseSlot(tileAlloyfurnace.inventory, 0, 47, 17));
|
this.addSlotToContainer(new SlotInputCustom(tileAlloyfurnace.inventory, 0, 47, 17, 0));
|
||||||
this.addSlotToContainer(new BaseSlot(tileAlloyfurnace.inventory, 1, 65, 17));
|
this.addSlotToContainer(new SlotInputCustom(tileAlloyfurnace.inventory, 1, 65, 17, 1));
|
||||||
// outputs
|
// outputs
|
||||||
this.addSlotToContainer(new SlotOutput(tileAlloyfurnace.inventory, 2, 116, 35));
|
this.addSlotToContainer(new SlotOutput(tileAlloyfurnace.inventory, 2, 116, 35));
|
||||||
// Fuel
|
// Fuel
|
||||||
|
@ -42,6 +53,30 @@ public class ContainerAlloyFurnace extends RebornContainer {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static class SlotInputCustom extends reborncore.client.gui.slots.BaseSlot {
|
||||||
|
|
||||||
|
int recipeSlot = 0;
|
||||||
|
|
||||||
|
public SlotInputCustom(IInventory inventoryIn, int index, int xPosition, int yPosition, int recipeSlot) {
|
||||||
|
super(inventoryIn, index, xPosition, yPosition);
|
||||||
|
this.recipeSlot = recipeSlot;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isItemValid(
|
||||||
|
@Nullable
|
||||||
|
ItemStack stack) {
|
||||||
|
for(IBaseRecipeType recipe : RecipeHandler.recipeList){
|
||||||
|
if(recipe instanceof AlloySmelterRecipe){
|
||||||
|
if(ItemUtils.isItemEqual(recipe.getInputs().get(recipeSlot), stack, true, true, true)){
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canInteractWith(EntityPlayer player) {
|
public boolean canInteractWith(EntityPlayer player) {
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -36,8 +36,8 @@ public class ContainerAlloySmelter extends ContainerCrafting {
|
||||||
public void addInventorySlots() {
|
public void addInventorySlots() {
|
||||||
|
|
||||||
// input
|
// input
|
||||||
this.addSlotToContainer(new SlotInput(tile.inventory, 0, 47, 17));
|
this.addSlotToContainer(new ContainerAlloyFurnace.SlotInputCustom(tile.inventory, 0, 47, 17, 0));
|
||||||
this.addSlotToContainer(new SlotInput(tile.inventory, 1, 65, 17));
|
this.addSlotToContainer(new ContainerAlloyFurnace.SlotInputCustom(tile.inventory, 1, 65, 17, 1));
|
||||||
// outputs
|
// outputs
|
||||||
this.addSlotToContainer(new SlotOutput(tile.inventory, 2, 116, 35));
|
this.addSlotToContainer(new SlotOutput(tile.inventory, 2, 116, 35));
|
||||||
// battery
|
// battery
|
||||||
|
|
|
@ -63,6 +63,7 @@ public class TechRebornDevCommand extends CommandBase {
|
||||||
blocksToRemove.add(Blocks.GRASS);
|
blocksToRemove.add(Blocks.GRASS);
|
||||||
blocksToRemove.add(Blocks.DIRT);
|
blocksToRemove.add(Blocks.DIRT);
|
||||||
blocksToRemove.add(Blocks.STONE);
|
blocksToRemove.add(Blocks.STONE);
|
||||||
|
blocksToRemove.add(Blocks.END_STONE);
|
||||||
for (int x = 0; x < 25; x++) {
|
for (int x = 0; x < 25; x++) {
|
||||||
for (int z = 0; z < 25; z++) {
|
for (int z = 0; z < 25; z++) {
|
||||||
for (int y = 0; y < playerMP.posY; y++) {
|
for (int y = 0; y < playerMP.posY; y++) {
|
||||||
|
|
|
@ -3155,7 +3155,7 @@ public class ModRecipes {
|
||||||
|
|
||||||
if (ConfigTechReborn.ExpensiveDrill)
|
if (ConfigTechReborn.ExpensiveDrill)
|
||||||
CraftingHelper
|
CraftingHelper
|
||||||
.addShapedOreRecipe(OreDictionary.getOres("drillBasic").get(0).copy(), " S ", "SCS", "SBS", 'S',
|
.addShapedOreRecipe(new ItemStack(ModItems.ironDrill), " S ", "SCS", "SBS", 'S',
|
||||||
"ingotSteel", 'B', "reBattery", 'C',
|
"ingotSteel", 'B', "reBattery", 'C',
|
||||||
"circuitBasic");
|
"circuitBasic");
|
||||||
|
|
||||||
|
|
|
@ -3,6 +3,7 @@ package techreborn.items.tools;
|
||||||
import me.modmuss50.jsonDestroyer.api.ITexturedItem;
|
import me.modmuss50.jsonDestroyer.api.ITexturedItem;
|
||||||
import net.minecraft.block.BlockDynamicLiquid;
|
import net.minecraft.block.BlockDynamicLiquid;
|
||||||
import net.minecraft.block.BlockStaticLiquid;
|
import net.minecraft.block.BlockStaticLiquid;
|
||||||
|
import net.minecraft.block.state.IBlockState;
|
||||||
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
|
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
|
||||||
import net.minecraft.entity.item.EntityItem;
|
import net.minecraft.entity.item.EntityItem;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
@ -26,6 +27,7 @@ import reborncore.common.IWrenchable;
|
||||||
import reborncore.common.tile.TileMachineBase;
|
import reborncore.common.tile.TileMachineBase;
|
||||||
import reborncore.common.util.RebornPermissions;
|
import reborncore.common.util.RebornPermissions;
|
||||||
import techreborn.blocks.fluid.BlockFluidBase;
|
import techreborn.blocks.fluid.BlockFluidBase;
|
||||||
|
import techreborn.blocks.storage.BlockEnergyStorage;
|
||||||
import techreborn.client.TechRebornCreativeTabMisc;
|
import techreborn.client.TechRebornCreativeTabMisc;
|
||||||
import techreborn.compat.CompatManager;
|
import techreborn.compat.CompatManager;
|
||||||
import techreborn.init.ModSounds;
|
import techreborn.init.ModSounds;
|
||||||
|
@ -68,13 +70,24 @@ public class ItemWrench extends ItemTR implements ITexturedItem {
|
||||||
return EnumActionResult.FAIL;
|
return EnumActionResult.FAIL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!player.isSneaking() && !player.world.isRemote) {
|
if (!player.isSneaking()) {
|
||||||
if (tile instanceof TileMachineBase) {
|
if (tile instanceof TileMachineBase) {
|
||||||
if (side != EnumFacing.DOWN && side != EnumFacing.UP) {
|
if (side != EnumFacing.DOWN && side != EnumFacing.UP) {
|
||||||
((TileMachineBase) tile).setFacing(side);
|
((TileMachineBase) tile).setFacing(side);
|
||||||
return EnumActionResult.SUCCESS;
|
return EnumActionResult.SUCCESS;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
IBlockState state = world.getBlockState(pos);
|
||||||
|
if(state.getBlock() instanceof BlockEnergyStorage){
|
||||||
|
EnumFacing facing = state.getValue(BlockEnergyStorage.FACING);
|
||||||
|
if(facing.getOpposite() == side){
|
||||||
|
facing = side;
|
||||||
|
} else {
|
||||||
|
facing = side.getOpposite();
|
||||||
|
}
|
||||||
|
world.setBlockState(pos, state.withProperty(BlockEnergyStorage.FACING, facing));
|
||||||
|
return EnumActionResult.SUCCESS;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return super.onItemUseFirst(player, world, pos, side, hitX, hitY, hitZ, hand);
|
return super.onItemUseFirst(player, world, pos, side, hitX, hitY, hitZ, hand);
|
||||||
}
|
}
|
||||||
|
|
|
@ -134,21 +134,21 @@ public class TechRebornWorldGen implements IWorldGenerator {
|
||||||
Type typeOfHashMap = new TypeToken<WorldGenConfig>() {
|
Type typeOfHashMap = new TypeToken<WorldGenConfig>() {
|
||||||
}.getType();
|
}.getType();
|
||||||
config = gson.fromJson(jsonString, typeOfHashMap);
|
config = gson.fromJson(jsonString, typeOfHashMap);
|
||||||
ArrayUtils.addAll(config.endOres, config.neatherOres, config.overworldOres).stream().forEach(oreConfig -> {
|
// ArrayUtils.addAll(config.endOres, config.neatherOres, config.overworldOres).stream().forEach(oreConfig -> {
|
||||||
if (oreConfig.minYHeight > oreConfig.maxYHeight) {
|
// if (oreConfig.minYHeight > oreConfig.maxYHeight) {
|
||||||
printError(oreConfig.blockName + " ore generation value is invalid, the min y height is bigger than the max y height, this ore value will be disabled in code");
|
// printError(oreConfig.blockName + " ore generation value is invalid, the min y height is bigger than the max y height, this ore value will be disabled in code");
|
||||||
|
//
|
||||||
oreConfig.minYHeight = -1;
|
// oreConfig.minYHeight = -1;
|
||||||
oreConfig.maxYHeight = -1;
|
// oreConfig.maxYHeight = -1;
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
if (oreConfig.minYHeight < 0 || oreConfig.maxYHeight < 0) {
|
// if (oreConfig.minYHeight < 0 || oreConfig.maxYHeight < 0) {
|
||||||
printError(oreConfig.blockName + " ore generation value is invalid, the min y height or the max y height is less than 0, this ore value will be disabled in code");
|
// printError(oreConfig.blockName + " ore generation value is invalid, the min y height or the max y height is less than 0, this ore value will be disabled in code");
|
||||||
oreConfig.minYHeight = -1;
|
// oreConfig.minYHeight = -1;
|
||||||
oreConfig.maxYHeight = -1;
|
// oreConfig.maxYHeight = -1;
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
});
|
// });
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Core.logHelper.error(
|
Core.logHelper.error(
|
||||||
"The ores.json file was invalid, bad things are about to happen, I will try and save the world now :");
|
"The ores.json file was invalid, bad things are about to happen, I will try and save the world now :");
|
||||||
|
@ -210,6 +210,7 @@ public class TechRebornWorldGen implements IWorldGenerator {
|
||||||
predicate = BlockMatcher.forBlock(Blocks.NETHERRACK);
|
predicate = BlockMatcher.forBlock(Blocks.NETHERRACK);
|
||||||
} else if (world.provider.getDimension() == 1) {
|
} else if (world.provider.getDimension() == 1) {
|
||||||
list.addAll(getAllGenOresFromList(config.endOres));
|
list.addAll(getAllGenOresFromList(config.endOres));
|
||||||
|
|
||||||
predicate = BlockMatcher.forBlock(Blocks.END_STONE);
|
predicate = BlockMatcher.forBlock(Blocks.END_STONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue