-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c41437f
commit dba54ec
Showing
23 changed files
with
667 additions
and
338 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
src/main/java/com/warmthdawn/mod/gugu_utils/config/HatchesConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package com.warmthdawn.mod.gugu_utils.config; | ||
|
||
import com.warmthdawn.mod.gugu_utils.GuGuUtils; | ||
import net.minecraftforge.common.config.Config; | ||
|
||
@Config(modid = GuGuUtils.MODID, category = "Hatches") | ||
public class HatchesConfig { | ||
@Config.Comment("Max aspect in aspect output hatch") | ||
public static int ASPECT_OUTPUT_HATCH_MAX_STORAGE = 500; | ||
@Config.Comment("Actions when a aspect output hatch are full, can be 'spill_random', 'spill_all' and 'halt'.") | ||
public static String ASPECT_OUTPUT_HATCH_FULL_ACTION = "spill_random"; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
110 changes: 110 additions & 0 deletions
110
src/main/java/com/warmthdawn/mod/gugu_utils/modularmachenary/aspect/BlockAspectHatch.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,110 @@ | ||
package com.warmthdawn.mod.gugu_utils.modularmachenary.aspect; | ||
|
||
import com.warmthdawn.mod.gugu_utils.GuGuUtils; | ||
import com.warmthdawn.mod.gugu_utils.common.VariantBlock; | ||
import com.warmthdawn.mod.gugu_utils.modularmachenary.common.IOHatchVariant; | ||
import net.minecraft.block.SoundType; | ||
import net.minecraft.block.material.Material; | ||
import net.minecraft.block.properties.PropertyEnum; | ||
import net.minecraft.block.state.IBlockState; | ||
import net.minecraft.entity.item.EntityItem; | ||
import net.minecraft.entity.item.EntityXPOrb; | ||
import net.minecraft.entity.player.EntityPlayer; | ||
import net.minecraft.init.SoundEvents; | ||
import net.minecraft.item.ItemStack; | ||
import net.minecraft.tileentity.TileEntity; | ||
import net.minecraft.util.BlockRenderLayer; | ||
import net.minecraft.util.EnumFacing; | ||
import net.minecraft.util.EnumHand; | ||
import net.minecraft.util.SoundCategory; | ||
import net.minecraft.util.math.BlockPos; | ||
import net.minecraft.world.World; | ||
import net.minecraftforge.fml.relauncher.Side; | ||
import net.minecraftforge.fml.relauncher.SideOnly; | ||
import org.jetbrains.annotations.Nullable; | ||
import thaumcraft.api.aspects.IEssentiaTransport; | ||
import thaumcraft.api.aura.AuraHelper; | ||
import thaumcraft.api.items.ItemsTC; | ||
import thaumcraft.common.lib.SoundsTC; | ||
import thaumcraft.common.tiles.devices.TileJarBrain; | ||
import thaumcraft.common.tiles.essentia.TileJarFillable; | ||
import thaumcraft.common.tiles.essentia.TileSmelter; | ||
|
||
import javax.annotation.Nonnull; | ||
|
||
import static com.warmthdawn.mod.gugu_utils.common.Constants.NAME_ASPECTHATCH; | ||
import static com.warmthdawn.mod.gugu_utils.common.Constants.RESOURCE_ASPECTHATCH; | ||
import static com.warmthdawn.mod.gugu_utils.tools.ResourceUtils.j; | ||
|
||
public class BlockAspectHatch extends VariantBlock<IOHatchVariant> { | ||
|
||
public static final PropertyEnum<IOHatchVariant> VARIANT = PropertyEnum.create("variant", IOHatchVariant.class); | ||
|
||
public BlockAspectHatch() { | ||
super(Material.ROCK, IOHatchVariant.class); | ||
setHardness(2.0F); | ||
setResistance(10.0F); | ||
setSoundType(SoundType.STONE); | ||
setHarvestLevel("pickaxe", 0); | ||
setRegistryName(RESOURCE_ASPECTHATCH); | ||
setTranslationKey(j(GuGuUtils.MODID, NAME_ASPECTHATCH)); | ||
|
||
} | ||
|
||
@Override | ||
public boolean eventReceived(IBlockState state, World worldIn, BlockPos pos, int id, int param) { | ||
worldIn.markBlockRangeForRenderUpdate(pos, pos); | ||
return true; | ||
} | ||
|
||
@Override | ||
@Nonnull | ||
@SideOnly(Side.CLIENT) | ||
public BlockRenderLayer getRenderLayer() { | ||
return BlockRenderLayer.CUTOUT; | ||
} | ||
|
||
@Override | ||
public void breakBlock(World worldIn, BlockPos pos, IBlockState state) { | ||
if (!worldIn.isRemote) { | ||
TileEntity tileentity = worldIn.getTileEntity(pos); | ||
if (tileentity instanceof TileAspectHatch) { | ||
((TileAspectHatch) tileentity).spillAll(); | ||
} | ||
} | ||
super.breakBlock(worldIn, pos, state); | ||
} | ||
|
||
@Override | ||
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ) { | ||
TileEntity te = world.getTileEntity(pos); | ||
if (te instanceof TileAspectHatch && player.isSneaking() && player.getHeldItem(hand).isEmpty()) { | ||
if (world.isRemote) { | ||
world.playSound((double) pos.getX() + 0.5D, (double) pos.getY() + 0.5D, (double) pos.getZ() + 0.5D, SoundsTC.jar, SoundCategory.BLOCKS, 0.4F, 1.0F, false); | ||
world.playSound((double) pos.getX() + 0.5D, (double) pos.getY() + 0.5D, (double) pos.getZ() + 0.5D, SoundEvents.ITEM_BOTTLE_FILL, SoundCategory.BLOCKS, 0.5F, 1.0F + (world.rand.nextFloat() - world.rand.nextFloat()) * 0.3F, false); | ||
} else { | ||
((TileAspectHatch) te).spillAll(); | ||
} | ||
return true; | ||
} | ||
return super.onBlockActivated(world, pos, state, player, hand, facing, hitX, hitY, hitZ); | ||
} | ||
|
||
@Override | ||
public boolean hasTileEntity(IBlockState state) { | ||
return true; | ||
} | ||
|
||
@Nullable | ||
@Override | ||
public TileEntity createTileEntity(World world, IBlockState state) { | ||
return new TileAspectHatch(); | ||
} | ||
|
||
|
||
@Override | ||
public PropertyEnum<IOHatchVariant> getVariant() { | ||
return VARIANT; | ||
} | ||
|
||
} |
59 changes: 0 additions & 59 deletions
59
...ain/java/com/warmthdawn/mod/gugu_utils/modularmachenary/aspect/BlockAspectInputHatch.java
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.