Added a creative panel, it provides infinite power and has no recipe.

(cherry picked from commit 456ee3c)
This commit is contained in:
modmuss50 2017-03-14 19:40:33 +00:00
parent 8132620dcf
commit 92acc51aaf
No known key found for this signature in database
GPG key ID: 203A5ED4D3E48BEA
7 changed files with 211 additions and 0 deletions

View file

@ -0,0 +1,51 @@
/*
* This file is part of TechReborn, licensed under the MIT License (MIT).
*
* Copyright (c) 2017 TechReborn
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package techreborn.blocks.generator;
import net.minecraft.block.material.Material;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import reborncore.common.BaseTileBlock;
import techreborn.client.TechRebornCreativeTab;
import techreborn.tiles.generator.TileCreativePanel;
/**
* Created by modmuss50 on 25/02/2016.
*/
public class BlockCreativePanel extends BaseTileBlock {
public BlockCreativePanel() {
super(Material.IRON);
setUnlocalizedName("techreborn.creativepanel");
setCreativeTab(TechRebornCreativeTab.instance);
setHardness(2.0F);
}
@Override
public TileEntity createNewTileEntity(World worldIn, int meta) {
return new TileCreativePanel();
}
}

View file

@ -107,6 +107,7 @@ public class ModBlocks {
public static Block EXTRACTOR; public static Block EXTRACTOR;
public static Block ELECTRIC_FURNACE; public static Block ELECTRIC_FURNACE;
public static Block SOLAR_PANEL; public static Block SOLAR_PANEL;
public static Block CREATIVE_PANEL;
public static Block WATER_MILL; public static Block WATER_MILL;
public static Block WIND_MILL; public static Block WIND_MILL;
public static Block RECYCLER; public static Block RECYCLER;
@ -373,6 +374,11 @@ public class ModBlocks {
GameRegistry.registerTileEntity(TileSolarPanel.class, "TileSolarPanel"); GameRegistry.registerTileEntity(TileSolarPanel.class, "TileSolarPanel");
Core.proxy.registerCustomBlockStateLocation(SOLAR_PANEL, "machines/generators/solar_panel"); Core.proxy.registerCustomBlockStateLocation(SOLAR_PANEL, "machines/generators/solar_panel");
CREATIVE_PANEL = new BlockCreativePanel();
registerBlock(CREATIVE_PANEL, "techreborn.creativepanel");
GameRegistry.registerTileEntity(TileCreativePanel.class, "TileCreativePanel");
Core.proxy.registerCustomBlockStateLocation(CREATIVE_PANEL, "machines/generators/creative_panel");
WATER_MILL = new BlockWaterMill(); WATER_MILL = new BlockWaterMill();
registerBlock(WATER_MILL, "techreborn.watermill"); registerBlock(WATER_MILL, "techreborn.watermill");
GameRegistry.registerTileEntity(TileWaterMill.class, "TileWaterMill"); GameRegistry.registerTileEntity(TileWaterMill.class, "TileWaterMill");

View file

@ -0,0 +1,124 @@
/*
* This file is part of TechReborn, licensed under the MIT License (MIT).
*
* Copyright (c) 2017 TechReborn
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package techreborn.tiles.generator;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumFacing;
import net.minecraftforge.fml.common.Optional;
import reborncore.api.power.EnumPowerTier;
import reborncore.common.IWrenchable;
import reborncore.common.powerSystem.TilePowerAcceptor;
import techreborn.init.ModBlocks;
import java.util.List;
/**
* Created by modmuss50 on 25/02/2016.
*/
public class TileCreativePanel extends TilePowerAcceptor implements IWrenchable {
boolean shouldMakePower = false;
boolean lastTickSate = false;
int powerToAdd;
public TileCreativePanel() {
super(1);
}
@Override
public void updateEntity() {
super.updateEntity();
this.setEnergy(getMaxPower());
}
@Override
public void addInfo(final List<String> info, final boolean isRealTile) {
super.addInfo(info, isRealTile);
}
@Override
public double getMaxPower() {
return 1000000;
}
@Override
public boolean canAcceptEnergy(final EnumFacing direction) {
return false;
}
@Override
public boolean canProvideEnergy(final EnumFacing direction) {
return true;
}
@Override
public double getMaxOutput() {
return 16192;
}
@Override
public double getMaxInput() {
return 0;
}
@Override
public EnumPowerTier getTier() {
return EnumPowerTier.LOW;
}
@Override
public boolean wrenchCanSetFacing(final EntityPlayer entityPlayer, final EnumFacing side) {
return false;
}
@Override
public EnumFacing getFacing() {
return this.getFacingEnum();
}
@Override
public boolean wrenchCanRemove(final EntityPlayer entityPlayer) {
return entityPlayer.isSneaking();
}
@Override
public float getWrenchDropRate() {
return 1.0F;
}
@Override
public ItemStack getWrenchDrop(final EntityPlayer p0) {
return new ItemStack(ModBlocks.SOLAR_PANEL);
}
//Done to prevent ic2 from exploding the adjacent blocks
@Override
@Optional.Method(modid = "IC2")
public int getSourceTier() {
return 0;
}
}

View file

@ -0,0 +1,30 @@
{
"forge_marker": 1,
"defaults": {
"transform": "forge:default-block",
"model": "cube_bottom_top",
"textures": {
"particle": "techreborn:blocks/machines/generators/creative_panel_side",
"top": "techreborn:blocks/machines/generators/creative_panel_top",
"down": "techreborn:blocks/machines/generators/generator_bottom",
"side": "techreborn:blocks/machines/generators/creative_panel_side"
}
},
"variants": {
"inventory": {
"transform": "forge:default-block",
"model": "cube_bottom_top",
"textures": {
"side": "techreborn:blocks/machines/generators/creative_panel_side"
}
},
"normal": {
"transform": "forge:default-block",
"model": "cube_bottom_top",
"textures": {
"side": "techreborn:blocks/machines/generators/creative_panel_side"
}
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB