├── LICENSE ├── README.md └── src ├── main ├── java │ └── com │ │ └── porpit │ │ └── minecamera │ │ ├── MineCamera.java │ │ ├── block │ │ ├── BlockLoader.java │ │ ├── BlockPhotoProcessor.java │ │ ├── BlockPictureFrame.java │ │ └── BlockPictureFrameMultiple.java │ │ ├── client │ │ ├── ClientProxy.java │ │ ├── ItemRenderLoader.java │ │ ├── KeyLoader.java │ │ ├── entity │ │ │ ├── EntityRenderFactory.java │ │ │ ├── EntityRenderLoader.java │ │ │ ├── model │ │ │ │ └── ModelEntityTripod.java │ │ │ └── render │ │ │ │ └── RenderEntityTripod.java │ │ ├── gui │ │ │ ├── GuiCamera.java │ │ │ ├── GuiPhotoProcessor.java │ │ │ └── GuiPictureBook.java │ │ └── tilerender │ │ │ ├── PictureFrameMultipleTileRenderer.java │ │ │ ├── PictureFrameTileRenderer.java │ │ │ └── TileRenderLoader.java │ │ ├── common │ │ ├── CommonProxy.java │ │ └── EventLoader.java │ │ ├── creativetab │ │ ├── CreativeTabsLoader.java │ │ └── CreativeTabsMineCamera.java │ │ ├── entity │ │ ├── EntityLoader.java │ │ └── EntityTripod.java │ │ ├── inventory │ │ ├── ContainerCamera.java │ │ ├── ContainerPhotoProcessor.java │ │ ├── ContainerPictureBook.java │ │ └── GuiElementLoader.java │ │ ├── item │ │ ├── ItemBattery.java │ │ ├── ItemCamera.java │ │ ├── ItemCntsTempLiquid.java │ │ ├── ItemDevelopingAgent.java │ │ ├── ItemFilm.java │ │ ├── ItemGlassesHelmet.java │ │ ├── ItemLoader.java │ │ ├── ItemPhotoPaper.java │ │ ├── ItemPicture.java │ │ ├── ItemPictureBook.java │ │ └── ItemTripod.java │ │ ├── network │ │ ├── MessageCameraDelaySet.java │ │ ├── MessageFailLoadImage.java │ │ ├── MessageImage.java │ │ ├── MessageImageRequest.java │ │ ├── MessageImageSyncSave.java │ │ ├── MessagePhotoProcessorStart.java │ │ ├── MessagePictureBookIndex.java │ │ ├── MessagePictureBookInput.java │ │ ├── MessagePlayerViewRender.java │ │ ├── MessageSpawnParticle.java │ │ ├── MessageTripodFilmOut.java │ │ ├── MessageUpdatePitchYaw.java │ │ └── NetworkLoader.java │ │ ├── tileentity │ │ ├── TileEntityLoader.java │ │ ├── TileEntityPhotoProcessor.java │ │ ├── TileEntityPictureFrame.java │ │ └── TileEntityPictureFrameMultiple.java │ │ ├── transform │ │ ├── CamDummy.java │ │ ├── CamEventHandler.java │ │ ├── CamPatchingLoader.java │ │ ├── CamTransformer.java │ │ ├── Transformer.java │ │ ├── TransformerNames.java │ │ └── notch-mcp.srg │ │ └── util │ │ ├── EnumFailLoadImage.java │ │ ├── LoadImageFileThread.java │ │ ├── PictureFactory.java │ │ ├── SaveImageThread.java │ │ ├── TripodActiveThread.java │ │ └── VideoMemoryCleaner.java └── resources │ ├── META-INF │ └── MANIFEST.MF │ ├── assets │ ├── minecamera │ │ ├── advancements │ │ │ └── default │ │ │ │ ├── craftcamera.json │ │ │ │ ├── craftcrafttripod.json │ │ │ │ ├── craftfilm.json │ │ │ │ ├── craftglasses.json │ │ │ │ ├── craftphoto_paper.json │ │ │ │ ├── craftpicture.json │ │ │ │ ├── craftpicture_book.json │ │ │ │ ├── craftpictureframe.json │ │ │ │ ├── craftpictureframe_multiple.json │ │ │ │ ├── craftprocessor.json │ │ │ │ └── root.json │ │ ├── blockstates │ │ │ ├── photoprocessor.json │ │ │ ├── pictureframe.json │ │ │ └── pictureframe_multiple.json │ │ ├── lang │ │ │ ├── en_US.lang │ │ │ └── zh_CN.lang │ │ ├── models │ │ │ ├── block │ │ │ │ ├── photoprocessor.json │ │ │ │ ├── pictureframe.json │ │ │ │ ├── pictureframe_multiple_corner.json │ │ │ │ ├── pictureframe_multiple_corner_1.json │ │ │ │ ├── pictureframe_multiple_edge.json │ │ │ │ ├── pictureframe_multiple_edge_1.json │ │ │ │ ├── pictureframe_multiple_mid.json │ │ │ │ └── pictureframestand.json │ │ │ └── item │ │ │ │ ├── battery.json │ │ │ │ ├── camera.json │ │ │ │ ├── cnts_temp_liquid.json │ │ │ │ ├── developing_agent.json │ │ │ │ ├── film.json │ │ │ │ ├── glasses_helmet.json │ │ │ │ ├── photo_paper.json │ │ │ │ ├── photoprocessor.json │ │ │ │ ├── picture.json │ │ │ │ ├── picture_book.json │ │ │ │ ├── pictureframe.json │ │ │ │ ├── pictureframe_multiple.json │ │ │ │ └── tripod.json │ │ ├── recipes │ │ │ ├── itemBattery.json │ │ │ ├── itemCamera.json │ │ │ ├── itemCamera_2.json │ │ │ ├── itemCntsTempLiquid.json │ │ │ ├── itemDevelopingAgent.json │ │ │ ├── itemFilm.json │ │ │ ├── itemGlassesHelmet.json │ │ │ ├── itemPhotoPaper.json │ │ │ ├── itemPictureBook.json │ │ │ ├── itemTripod.json │ │ │ ├── photoprocessor.json │ │ │ ├── pictureFrame.json │ │ │ └── pictureFrameMultiple.json │ │ ├── sounds.json │ │ ├── sounds │ │ │ ├── book.ogg │ │ │ ├── kacha.ogg │ │ │ └── output.ogg │ │ └── textures │ │ │ ├── blocks │ │ │ ├── grass_block.png │ │ │ ├── photoprocessor.png │ │ │ ├── pictureframe.png │ │ │ ├── pictureframe_multiple_corner.png │ │ │ └── pictureframe_multiple_edge.png │ │ │ ├── entity │ │ │ └── tripod.png │ │ │ ├── gui │ │ │ ├── container │ │ │ │ ├── gui_camera.png │ │ │ │ ├── gui_photoprocessor.png │ │ │ │ └── gui_picture_book.png │ │ │ └── image │ │ │ │ ├── advancement_bg.png │ │ │ │ ├── cameragui.png │ │ │ │ ├── donate.png │ │ │ │ ├── failtoload.png │ │ │ │ └── loding.png │ │ │ ├── items │ │ │ ├── battery.png │ │ │ ├── camera.png │ │ │ ├── cnst_temp_liquid.png │ │ │ ├── developing_agent.png │ │ │ ├── film.png │ │ │ ├── glasses_helmet.png │ │ │ ├── photo_paper.png │ │ │ ├── picture.png │ │ │ ├── picture_book.png │ │ │ ├── pictureframe_multiple.png │ │ │ └── tripod.png │ │ │ └── models │ │ │ └── armor │ │ │ └── glasses_layer_1.png │ └── minecraft │ │ └── textures │ │ └── gui │ │ └── container │ │ └── creative_inventory │ │ └── tab_minecamera.png │ └── mcmod.info └── rebel.xml /README.md: -------------------------------------------------------------------------------- 1 | # MineCamera|摄影工艺 2 | A MineCraft mod porject|我的世界模组 3 | 4 | ![](http://i1.fuimg.com/508137/1468eb25e2308068.png) 5 | 6 | support minecraft version:1.8.9 1.10.2 1.11.2 1.12.2 7 | 8 | 支持游戏版本:1.8.9 1.10.2 1.11.2 1.12.2 9 | 10 | master分支:1.10.2 11 | 12 | Contacts|联系方式:
13 | 14 | EMail:692066768@qq.com 15 | 16 | 更早更新日志在taobao SVN上面:http://code.taobao.org/p/MineCamera/logs/ 17 | 18 | # 版权声明 19 | 20 | 本作品作者为PorPit。 21 | 22 | 所有源代码使用GPL-3.0协议开源,请务必遵守协议内容! 23 | 24 | 请勿抹去一切作者信息以及捐赠信息! 25 | 26 | 捐赠方式:https://afdian.net/@PorPit 27 | 28 | ![](http://i2.fuimg.com/508137/2e4758e8d2d4138c.png) 29 | -------------------------------------------------------------------------------- /src/main/java/com/porpit/minecamera/MineCamera.java: -------------------------------------------------------------------------------- 1 | package com.porpit.minecamera; 2 | 3 | import com.porpit.minecamera.common.CommonProxy; 4 | 5 | import net.minecraft.client.Minecraft; 6 | import net.minecraftforge.common.DimensionManager; 7 | import net.minecraftforge.fml.common.Mod; 8 | import net.minecraftforge.fml.common.Mod.EventHandler; 9 | import net.minecraftforge.fml.common.Mod.Instance; 10 | import net.minecraftforge.fml.common.SidedProxy; 11 | import net.minecraftforge.fml.common.event.FMLInitializationEvent; 12 | import net.minecraftforge.fml.common.event.FMLPostInitializationEvent; 13 | import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; 14 | import net.minecraftforge.fml.common.event.FMLServerStartingEvent; 15 | import net.minecraftforge.fml.relauncher.Side; 16 | import net.minecraftforge.fml.relauncher.SideOnly; 17 | import scala.reflect.internal.Trees.This; 18 | 19 | @Mod(modid = MineCamera.MODID, name = MineCamera.NAME, version = MineCamera.VERSION, dependencies="after:MineCameraDummy;", acceptedMinecraftVersions = "1.12.2") 20 | public class MineCamera { 21 | public static final String MODID = "minecamera"; 22 | public static final String NAME = "MineCamera"; 23 | public static final String VERSION = "1.1.1"; 24 | 25 | public static String ServerCatchFile; 26 | public static String ClientCatchFile ; 27 | 28 | @SidedProxy(clientSide = "com.porpit.minecamera.client.ClientProxy", serverSide = "com.porpit.minecamera.common.CommonProxy") 29 | public static CommonProxy proxy; 30 | @Instance(MineCamera.MODID) 31 | public static MineCamera instance; 32 | 33 | @EventHandler 34 | public void serverStarting(FMLServerStartingEvent event) { 35 | proxy.serverStarting(event); 36 | } 37 | 38 | @EventHandler 39 | public void preInit(FMLPreInitializationEvent event) { 40 | ServerCatchFile=event.getSourceFile().getParentFile().toString()+"\\minecamera\\serverdata\\"; 41 | ClientCatchFile=event.getSourceFile().getParentFile().toString()+"\\minecamera\\catchdata\\"; 42 | proxy.preInit(event); 43 | } 44 | 45 | @EventHandler 46 | public void init(FMLInitializationEvent event) { 47 | proxy.init(event); 48 | } 49 | 50 | @EventHandler 51 | public void postInit(FMLPostInitializationEvent event) { 52 | proxy.postInit(event); 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /src/main/java/com/porpit/minecamera/block/BlockLoader.java: -------------------------------------------------------------------------------- 1 | package com.porpit.minecamera.block; 2 | 3 | import net.minecraft.block.Block; 4 | import net.minecraft.client.renderer.block.model.ModelResourceLocation; 5 | import net.minecraft.item.Item; 6 | import net.minecraft.item.ItemBlock; 7 | import net.minecraftforge.client.model.ModelLoader; 8 | import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; 9 | import net.minecraftforge.fml.common.registry.ForgeRegistries; 10 | import net.minecraftforge.fml.common.registry.GameRegistry; 11 | import net.minecraftforge.fml.relauncher.Side; 12 | import net.minecraftforge.fml.relauncher.SideOnly; 13 | 14 | public class BlockLoader { 15 | public static Block pictureFrame = new BlockPictureFrame(); 16 | public static Block photoprocessor = new BlockPhotoProcessor(); 17 | public static Block pictureFrameMultiple= new BlockPictureFrameMultiple(); 18 | 19 | public BlockLoader(FMLPreInitializationEvent event) { 20 | // register(pictureFrame, "picture_frame"); 21 | register(pictureFrame, "pictureframe"); 22 | register(photoprocessor, "photoprocessor"); 23 | register(pictureFrameMultiple, "pictureframe_multiple"); 24 | } 25 | 26 | @SideOnly(Side.CLIENT) 27 | public static void registerRenders() { 28 | registerRender(pictureFrame); 29 | registerRender(photoprocessor); 30 | registerRender(pictureFrameMultiple); 31 | } 32 | 33 | private static void register(Block block, String name) { 34 | ForgeRegistries.BLOCKS.register(block.setRegistryName(name)); 35 | ForgeRegistries.ITEMS.register(new ItemBlock(block).setRegistryName(name)); 36 | } 37 | 38 | @SideOnly(Side.CLIENT) 39 | private static void registerRender(Block block, int meta, String name) { 40 | ModelResourceLocation model = new ModelResourceLocation(block.getRegistryName(), "inventory"); 41 | ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(block), meta, model); 42 | } 43 | 44 | @SideOnly(Side.CLIENT) 45 | private static void registerRender(Block block) { 46 | registerRender(block, 0, block.getRegistryName().getResourcePath()); 47 | } 48 | 49 | } 50 | -------------------------------------------------------------------------------- /src/main/java/com/porpit/minecamera/block/BlockPhotoProcessor.java: -------------------------------------------------------------------------------- 1 | package com.porpit.minecamera.block; 2 | 3 | import javax.annotation.Nullable; 4 | 5 | import com.porpit.minecamera.MineCamera; 6 | import com.porpit.minecamera.creativetab.CreativeTabsLoader; 7 | import com.porpit.minecamera.inventory.GuiElementLoader; 8 | import com.porpit.minecamera.tileentity.TileEntityPhotoProcessor; 9 | 10 | import net.minecraft.block.Block; 11 | import net.minecraft.block.BlockContainer; 12 | import net.minecraft.block.SoundType; 13 | import net.minecraft.block.material.Material; 14 | import net.minecraft.block.properties.PropertyDirection; 15 | import net.minecraft.block.state.BlockStateContainer; 16 | import net.minecraft.block.state.IBlockState; 17 | import net.minecraft.entity.EntityLivingBase; 18 | import net.minecraft.entity.player.EntityPlayer; 19 | import net.minecraft.init.Items; 20 | import net.minecraft.item.ItemStack; 21 | import net.minecraft.tileentity.TileEntity; 22 | import net.minecraft.util.EnumBlockRenderType; 23 | import net.minecraft.util.EnumFacing; 24 | import net.minecraft.util.EnumHand; 25 | import net.minecraft.util.math.BlockPos; 26 | import net.minecraft.world.World; 27 | import net.minecraftforge.items.CapabilityItemHandler; 28 | import net.minecraftforge.items.IItemHandler; 29 | import net.minecraftforge.items.IItemHandlerModifiable; 30 | 31 | public class BlockPhotoProcessor extends BlockContainer { 32 | public static final PropertyDirection FACING = PropertyDirection.create("facing", EnumFacing.Plane.HORIZONTAL); 33 | 34 | public BlockPhotoProcessor() { 35 | super(Material.GROUND); 36 | this.setUnlocalizedName("photoprocessor"); 37 | this.setHardness(0.5F); 38 | this.setSoundType(SoundType.ANVIL); 39 | this.setCreativeTab(CreativeTabsLoader.tabMineCamera); 40 | this.setDefaultState(this.blockState.getBaseState().withProperty(FACING, EnumFacing.NORTH)); 41 | } 42 | 43 | @Override 44 | public TileEntity createNewTileEntity(World worldIn, int meta) { 45 | return new TileEntityPhotoProcessor(); 46 | } 47 | 48 | @Override 49 | public IBlockState getStateFromMeta(int meta) { 50 | EnumFacing facing = EnumFacing.getHorizontal(meta & 3); 51 | return this.getDefaultState().withProperty(FACING, facing); 52 | } 53 | 54 | @Override 55 | public void breakBlock(World worldIn, BlockPos pos, IBlockState state) { 56 | TileEntityPhotoProcessor te = (TileEntityPhotoProcessor) worldIn.getTileEntity(pos); 57 | 58 | IItemHandler inv = te.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, EnumFacing.UP); 59 | 60 | for (int i = inv.getSlots() - 1; i >= 0; --i) { 61 | if (inv.getStackInSlot(i) != null) { 62 | Block.spawnAsEntity(worldIn, pos, inv.getStackInSlot(i)); 63 | ((IItemHandlerModifiable) inv).setStackInSlot(i, ItemStack.EMPTY); 64 | } 65 | } 66 | 67 | super.breakBlock(worldIn, pos, state); 68 | } 69 | 70 | @Override 71 | public int getMetaFromState(IBlockState state) { 72 | int facing = state.getValue(FACING).getHorizontalIndex(); 73 | // System.out.println(facing); 74 | return facing; 75 | } 76 | 77 | @Override 78 | public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ) { 79 | if (!worldIn.isRemote) { 80 | int id = GuiElementLoader.GUI_PHOTOPROCESSOR; 81 | playerIn.openGui(MineCamera.instance, id, worldIn, pos.getX(), pos.getY(), pos.getZ()); 82 | /* 83 | * Entity entity = new EntityTripod(worldIn); 84 | * entity.setPositionAndUpdate(pos.getX() + 0.5, pos.getY() + 0.5, 85 | * pos.getZ() + 0.5); worldIn.spawnEntityInWorld(entity); 86 | */ 87 | } 88 | return true; 89 | } 90 | 91 | @Override 92 | public IBlockState getStateForPlacement(World world, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer, EnumHand hand) 93 | { 94 | IBlockState origin = super.getStateForPlacement(world, pos, facing, hitX, hitY, hitZ, meta, placer, hand); 95 | return origin.withProperty(FACING, placer.getHorizontalFacing().getOpposite()); 96 | } 97 | 98 | /*@Override 99 | public IBlockState onBlockPlacedBy(World worldIn, BlockPos pos, IBlockState state, EntityLivingBase placer, ItemStack stack) { 100 | IBlockState origin = super.onBlockPlaced(worldIn, pos, facing, hitX, hitY, hitZ, meta, placer); 101 | return origin.withProperty(FACING, placer.getHorizontalFacing().getOpposite()); 102 | }*/ 103 | 104 | @Override 105 | public EnumBlockRenderType getRenderType(IBlockState state) { 106 | return EnumBlockRenderType.MODEL; 107 | } 108 | 109 | @Override 110 | public boolean isFullCube(IBlockState state) { 111 | return false; 112 | } 113 | 114 | @Override 115 | protected BlockStateContainer createBlockState() { 116 | return new BlockStateContainer(this, FACING); 117 | } 118 | 119 | @Override 120 | public boolean isOpaqueCube(IBlockState state) { 121 | return false; 122 | } 123 | } 124 | -------------------------------------------------------------------------------- /src/main/java/com/porpit/minecamera/block/BlockPictureFrame.java: -------------------------------------------------------------------------------- 1 | package com.porpit.minecamera.block; 2 | 3 | import java.util.List; 4 | 5 | import javax.annotation.Nullable; 6 | 7 | import com.porpit.minecamera.creativetab.CreativeTabsLoader; 8 | import com.porpit.minecamera.item.ItemLoader; 9 | import com.porpit.minecamera.tileentity.TileEntityPictureFrame; 10 | 11 | import net.minecraft.block.Block; 12 | import net.minecraft.block.BlockContainer; 13 | import net.minecraft.block.SoundType; 14 | import net.minecraft.block.material.Material; 15 | import net.minecraft.block.properties.PropertyDirection; 16 | import net.minecraft.block.properties.PropertyEnum; 17 | import net.minecraft.block.state.BlockStateContainer; 18 | import net.minecraft.block.state.IBlockState; 19 | import net.minecraft.client.resources.I18n; 20 | import net.minecraft.client.util.ITooltipFlag; 21 | import net.minecraft.entity.EntityLivingBase; 22 | import net.minecraft.entity.item.EntityItem; 23 | import net.minecraft.entity.player.EntityPlayer; 24 | import net.minecraft.item.ItemStack; 25 | import net.minecraft.nbt.NBTTagCompound; 26 | import net.minecraft.tileentity.TileEntity; 27 | import net.minecraft.util.EnumBlockRenderType; 28 | import net.minecraft.util.EnumFacing; 29 | import net.minecraft.util.EnumHand; 30 | import net.minecraft.util.IStringSerializable; 31 | import net.minecraft.util.math.AxisAlignedBB; 32 | import net.minecraft.util.math.BlockPos; 33 | import net.minecraft.util.text.TextFormatting; 34 | import net.minecraft.world.IBlockAccess; 35 | import net.minecraft.world.World; 36 | import net.minecraftforge.fml.relauncher.Side; 37 | import net.minecraftforge.fml.relauncher.SideOnly; 38 | 39 | public class BlockPictureFrame extends BlockContainer { 40 | public static final PropertyDirection FACING = PropertyDirection.create("facing", EnumFacing.Plane.HORIZONTAL); 41 | public static final PropertyEnum STATETYPE = PropertyEnum.create("statetype", EnumStateType.class); 42 | public AxisAlignedBB FACING_NORTH = new AxisAlignedBB(0.0D, 0.1D, 0.95D, 1.0D, 0.9D, 1.0D); 43 | 44 | public BlockPictureFrame() { 45 | super(Material.GROUND); 46 | this.setUnlocalizedName("pictureframe"); 47 | this.setHardness(0.5F); 48 | this.setSoundType(SoundType.WOOD); 49 | this.setCreativeTab(CreativeTabsLoader.tabMineCamera); 50 | this.setDefaultState(this.blockState.getBaseState().withProperty(FACING, EnumFacing.NORTH) 51 | .withProperty(STATETYPE, EnumStateType.STANDING)); 52 | } 53 | 54 | @Override 55 | public void breakBlock(World worldIn, BlockPos pos, IBlockState state) { 56 | // System.out.println("123"); 57 | if (!worldIn.isRemote) { 58 | TileEntityPictureFrame te = (TileEntityPictureFrame) worldIn.getTileEntity(pos); 59 | if (!te.imagename.equals("")) { 60 | ItemStack picture = new ItemStack(ItemLoader.itemPicture); 61 | NBTTagCompound nbt = new NBTTagCompound(); 62 | nbt.setString("pid", te.imagename); 63 | picture.setTagCompound(nbt); 64 | // worldIn.spawnEntityInWorld(new EntityItem(worldIn, 65 | // pos.getX(), pos.getY(), pos.getZ(), picture)); 66 | Block.spawnAsEntity(worldIn, pos, picture); 67 | } 68 | } 69 | super.breakBlock(worldIn, pos, state); 70 | 71 | } 72 | 73 | @Override 74 | public void onBlockPlacedBy(World worldIn, BlockPos pos, IBlockState state, EntityLivingBase placer, 75 | ItemStack stack) { 76 | } 77 | 78 | @Override 79 | public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos) { 80 | if (state.getValue(STATETYPE).equals(EnumStateType.HANDGING)) { 81 | switch (state.getValue(FACING).getIndex()) { 82 | // north 83 | case 2: 84 | return new AxisAlignedBB(0.0D, 0.1D, 0.95D, 1.0D, 0.9D, 1.0D); 85 | // south 86 | case 3: 87 | return new AxisAlignedBB(0.0D, 0.1D, 0.0D, 1.0D, 0.9D, 0.05D); 88 | // west 89 | case 4: 90 | return new AxisAlignedBB(0.95D, 0.1D, 0.0D, 1.0D, 0.9D, 1.0D); 91 | // east 92 | case 5: 93 | return new AxisAlignedBB(0.0D, 0.1D, 0.0D, 0.05D, 0.9D, 1.0D); 94 | default: 95 | return new AxisAlignedBB(0.0D, 0.1D, 0.95D, 1.0D, 0.9D, 1.0D); 96 | } 97 | } else { 98 | switch (state.getValue(FACING).getIndex()) { 99 | // north 100 | case 2: 101 | return new AxisAlignedBB(0.0D, 0.0D, 0.35D, 1.0D, 0.75D, 0.8D); 102 | // south 103 | case 3: 104 | return new AxisAlignedBB(0.0D, 0.0D, 0.20D, 1.0D, 0.75D, 0.65D); 105 | // west 106 | case 4: 107 | return new AxisAlignedBB(0.35D, 0.0D, 0.0D, 0.8D, 0.75D, 1.0D); 108 | // east 109 | case 5: 110 | return new AxisAlignedBB(0.2D, 0.0D, 0.0D, 0.65D, 0.75D, 1.0D); 111 | default: 112 | return new AxisAlignedBB(0.0D, 0.0D, 0.35D, 1.0D, 0.75D, 0.8D); 113 | } 114 | } 115 | } 116 | 117 | @Override 118 | protected BlockStateContainer createBlockState() { 119 | return new BlockStateContainer(this, FACING, STATETYPE); 120 | } 121 | 122 | @Override 123 | public boolean isFullCube(IBlockState state) { 124 | return false; 125 | } 126 | 127 | @Override 128 | public boolean isOpaqueCube(IBlockState state) { 129 | return false; 130 | } 131 | 132 | @Override 133 | public EnumBlockRenderType getRenderType(IBlockState state) { 134 | return EnumBlockRenderType.MODEL; 135 | } 136 | 137 | @Override 138 | public TileEntity createNewTileEntity(World worldIn, int meta) { 139 | return new TileEntityPictureFrame(); 140 | } 141 | 142 | @Override 143 | public boolean canPlaceBlockAt(World worldIn, BlockPos pos){ 144 | return true; 145 | } 146 | 147 | @Override 148 | public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ) { 149 | // System.out.println(((TileEntityPictureFrame) 150 | // worldIn.getTileEntity(pos)).imagename); 151 | ItemStack heldItem=playerIn.getHeldItem(hand); 152 | if(!(worldIn.getTileEntity(pos) instanceof TileEntityPictureFrame)){ 153 | return true; 154 | } 155 | TileEntityPictureFrame te=(TileEntityPictureFrame) worldIn.getTileEntity(pos); 156 | if (heldItem != null && heldItem.getItem().equals(ItemLoader.itemPicture) && heldItem.hasTagCompound()&&heldItem.getTagCompound().hasKey("pid")) { 157 | //System.out.println(hand); 158 | String imagename = heldItem.getTagCompound().getString("pid"); 159 | if (!worldIn.isRemote && !te.imagename.equals("")) { 160 | ItemStack picture = new ItemStack(ItemLoader.itemPicture); 161 | NBTTagCompound nbt = new NBTTagCompound(); 162 | nbt.setString("pid", te.imagename); 163 | picture.setTagCompound(nbt); 164 | Block.spawnAsEntity(worldIn, pos, picture); 165 | //worldIn.spawnEntityInWorld(new EntityItem(worldIn, pos.getX(), pos.getY(), pos.getZ(), )); 166 | } 167 | te.imagename = imagename; 168 | te.updateBlock(); 169 | heldItem.shrink(1); 170 | } 171 | if(!worldIn.isRemote&&heldItem == null&&!te.imagename.equals("")){ 172 | ItemStack picture = new ItemStack(ItemLoader.itemPicture); 173 | NBTTagCompound nbt = new NBTTagCompound(); 174 | nbt.setString("pid", te.imagename); 175 | picture.setTagCompound(nbt); 176 | Block.spawnAsEntity(worldIn, pos, picture); 177 | te.imagename = ""; 178 | te.updateBlock(); 179 | } 180 | // playerIn.addChatComponentMessage((new 181 | // TextComponentTranslation("test"))); 182 | return true; 183 | } 184 | 185 | @Override 186 | public IBlockState getStateFromMeta(int meta) { 187 | EnumFacing facing = EnumFacing.getHorizontal(meta & 3); 188 | EnumStateType statetype = EnumStateType.values()[meta >> 2]; 189 | return this.getDefaultState().withProperty(FACING, facing).withProperty(STATETYPE, statetype); 190 | } 191 | 192 | @Override 193 | public int getMetaFromState(IBlockState state) { 194 | int facing = state.getValue(FACING).getHorizontalIndex(); 195 | // System.out.println(facing); 196 | int statetype = state.getValue(STATETYPE).ordinal() << 2; 197 | return facing | statetype; 198 | } 199 | 200 | @Override 201 | public IBlockState getStateForPlacement(World world, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer, EnumHand hand) { 202 | // System.out.println("hitX:=" + hitX + ",hitY:" + hitY + ",hitZ:" + 203 | // hitZ); 204 | IBlockState origin = super.getStateForPlacement(world, pos, facing, hitX, hitY, hitZ, meta, placer, hand); 205 | EnumStateType enumState; 206 | if (hitY == 1.0) { 207 | enumState = EnumStateType.STANDING; 208 | } else { 209 | enumState = EnumStateType.HANDGING; 210 | } 211 | 212 | return origin.withProperty(FACING, placer.getHorizontalFacing().getOpposite()).withProperty(STATETYPE, 213 | enumState); 214 | } 215 | 216 | public static enum EnumStateType implements IStringSerializable { 217 | HANDGING("hanging"), STANDING("standing"); 218 | 219 | private String name; 220 | 221 | private EnumStateType(String material) { 222 | this.name = material; 223 | } 224 | 225 | @Override 226 | public String getName() { 227 | return this.name; 228 | } 229 | 230 | @Override 231 | public String toString() { 232 | return this.name; 233 | } 234 | } 235 | 236 | @Override 237 | @SideOnly(Side.CLIENT) 238 | public void addInformation(ItemStack stack, @Nullable World player, List tooltip, ITooltipFlag advanced) { 239 | tooltip.add(TextFormatting.BLUE+ I18n.format("lore.pictureframe.info")); 240 | } 241 | } 242 | -------------------------------------------------------------------------------- /src/main/java/com/porpit/minecamera/block/BlockPictureFrameMultiple.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PorPit/MineCamera/d52eb883f2af9a8f66cf183060898c7672c9a471/src/main/java/com/porpit/minecamera/block/BlockPictureFrameMultiple.java -------------------------------------------------------------------------------- /src/main/java/com/porpit/minecamera/client/ClientProxy.java: -------------------------------------------------------------------------------- 1 | package com.porpit.minecamera.client; 2 | 3 | import com.porpit.minecamera.client.entity.EntityRenderLoader; 4 | import com.porpit.minecamera.client.tilerender.PictureFrameTileRenderer; 5 | import com.porpit.minecamera.client.tilerender.TileRenderLoader; 6 | import com.porpit.minecamera.common.CommonProxy; 7 | import com.porpit.minecamera.tileentity.TileEntityPictureFrame; 8 | import com.porpit.minecamera.util.VideoMemoryCleaner; 9 | 10 | import net.minecraft.client.Minecraft; 11 | import net.minecraftforge.fml.client.registry.ClientRegistry; 12 | import net.minecraftforge.fml.common.event.FMLInitializationEvent; 13 | import net.minecraftforge.fml.common.event.FMLPostInitializationEvent; 14 | import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; 15 | import net.minecraftforge.fml.relauncher.Side; 16 | import net.minecraftforge.fml.relauncher.SideOnly; 17 | 18 | public class ClientProxy extends CommonProxy { 19 | @Override 20 | public void preInit(FMLPreInitializationEvent event) { 21 | super.preInit(event); 22 | new ItemRenderLoader(); 23 | //ClientRegistry.bindTileEntitySpecialRenderer(TileEntityPictureFrame.class, new PictureFrameTileRenderer()); 24 | new TileRenderLoader(); 25 | new EntityRenderLoader(); 26 | VideoMemoryCleaner vmCleaner=new VideoMemoryCleaner(); 27 | vmCleaner.start(); 28 | } 29 | 30 | @Override 31 | public void init(FMLInitializationEvent event) { 32 | super.init(event); 33 | new KeyLoader(); 34 | } 35 | 36 | @Override 37 | public void postInit(FMLPostInitializationEvent event) { 38 | super.postInit(event); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/main/java/com/porpit/minecamera/client/ItemRenderLoader.java: -------------------------------------------------------------------------------- 1 | package com.porpit.minecamera.client; 2 | 3 | import com.porpit.minecamera.block.BlockLoader; 4 | import com.porpit.minecamera.item.ItemLoader; 5 | 6 | public class ItemRenderLoader { 7 | public ItemRenderLoader() { 8 | BlockLoader.registerRenders(); 9 | ItemLoader.registerRenders(); 10 | } 11 | } -------------------------------------------------------------------------------- /src/main/java/com/porpit/minecamera/client/KeyLoader.java: -------------------------------------------------------------------------------- 1 | package com.porpit.minecamera.client; 2 | 3 | import org.lwjgl.input.Keyboard; 4 | 5 | import net.minecraft.client.settings.KeyBinding; 6 | import net.minecraftforge.fml.client.registry.ClientRegistry; 7 | 8 | public class KeyLoader { 9 | 10 | public static KeyBinding cameralock; 11 | 12 | public KeyLoader() 13 | { 14 | KeyLoader.cameralock = new KeyBinding("key.minecamera.cameralock", Keyboard.KEY_LCONTROL, "key.categories.mincamera"); 15 | 16 | ClientRegistry.registerKeyBinding(KeyLoader.cameralock); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/com/porpit/minecamera/client/entity/EntityRenderFactory.java: -------------------------------------------------------------------------------- 1 | package com.porpit.minecamera.client.entity; 2 | 3 | import net.minecraft.client.renderer.entity.Render; 4 | import net.minecraft.client.renderer.entity.RenderManager; 5 | import net.minecraft.entity.Entity; 6 | import net.minecraftforge.fml.client.registry.IRenderFactory; 7 | 8 | public class EntityRenderFactory implements IRenderFactory { 9 | private final Class> renderClass; 10 | 11 | public EntityRenderFactory(Class> renderClass) { 12 | this.renderClass = renderClass; 13 | } 14 | 15 | @Override 16 | public Render createRenderFor(RenderManager manager) { 17 | try { 18 | return renderClass.getConstructor(RenderManager.class).newInstance(manager); 19 | } catch (Exception e) { 20 | throw new RuntimeException(e); 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/main/java/com/porpit/minecamera/client/entity/EntityRenderLoader.java: -------------------------------------------------------------------------------- 1 | package com.porpit.minecamera.client.entity; 2 | 3 | import com.porpit.minecamera.entity.EntityLoader; 4 | 5 | public class EntityRenderLoader { 6 | public EntityRenderLoader() { 7 | EntityLoader.registerRenders(); 8 | } 9 | } -------------------------------------------------------------------------------- /src/main/java/com/porpit/minecamera/client/entity/model/ModelEntityTripod.java: -------------------------------------------------------------------------------- 1 | package com.porpit.minecamera.client.entity.model; 2 | 3 | import net.minecraft.client.renderer.GlStateManager; 4 | import org.lwjgl.opengl.GL11; 5 | 6 | import net.minecraft.client.model.ModelBase; 7 | import net.minecraft.client.model.ModelRenderer; 8 | import net.minecraft.entity.Entity; 9 | import net.minecraftforge.fml.relauncher.Side; 10 | import net.minecraftforge.fml.relauncher.SideOnly; 11 | 12 | @SideOnly(Side.CLIENT) 13 | public class ModelEntityTripod extends ModelBase { 14 | public ModelRenderer top1; 15 | public ModelRenderer top2; 16 | public ModelRenderer top3; 17 | public ModelRenderer leg1; 18 | public ModelRenderer leg2; 19 | public ModelRenderer leg3; 20 | 21 | public ModelEntityTripod() { 22 | this.textureHeight = 64; 23 | this.textureWidth = 512; 24 | System.out.println("12312312312123123"); 25 | this.top1 = new ModelRenderer(this, 0, 0); 26 | this.top1.addBox(-25F, 0F, -5F, 50, 30, 10, 0F); 27 | this.top1.setRotationPoint(0F, 0F, 0F); 28 | this.top1.setTextureSize(120, 40); 29 | setRotation(top1, 0F, 0F, 0F); 30 | this.top2 = new ModelRenderer(this, 141, 0); 31 | this.top2.addBox(-15F, 30F, -15F, 30, 10, 30, 0F); 32 | this.top2.setRotationPoint(0F, 0F, 0F); 33 | this.top2.setTextureSize(120, 40); 34 | setRotation(top2, 0F, 0F, 0F); 35 | this.top3 = new ModelRenderer(this, 120, 0); 36 | this.top3.addBox(-15F, -5F, -5F, 15, 5, 10, 0F); 37 | this.top3.setRotationPoint(0F, 0F, 0F); 38 | this.top3.setTextureSize(50, 15); 39 | setRotation(top3, 0F, 0F, 0F); 40 | this.leg1 = new ModelRenderer(this, 0, 40); 41 | this.leg1.addBox(0F, 0F, 0F, 246, 10, 10, 0F); 42 | this.leg1.offsetY = 15; 43 | this.leg1.setRotationPoint(0F, 0F, 0F); 44 | this.leg1.setTextureSize(512, 20); 45 | setRotation(leg1, 0F, 0.4F, 1.2F); 46 | this.leg2 = new ModelRenderer(this, 0, 40); 47 | this.leg2.addBox(0F, 0F, 0F, 246, 10, 10, 0F); 48 | this.leg2.offsetY = 15; 49 | this.leg2.setRotationPoint(0F, 0F, 0F); 50 | this.leg2.setTextureSize(512, 20); 51 | setRotation(leg2, 0F, 0.4F, 1.9F); 52 | this.leg3 = new ModelRenderer(this, 0, 40); 53 | this.leg3.offsetY = 5; 54 | this.leg3.addBox(0F, 0F, 0F, 246, 10, 10, 0F); 55 | this.leg3.setRotationPoint(0F, 0F, 0F); 56 | this.leg3.setTextureSize(512, 20); 57 | setRotation(leg3, 0F, -0.4F, 1.6F); 58 | } 59 | 60 | @Override 61 | public void render(Entity entity, float limbSwing, float limbSwingAmount, float rotateFloat, float rotateYaw, 62 | float rotatePitch, float scale) { 63 | GL11.glScalef(0.014F, 0.014F, 0.014F); 64 | GL11.glTranslatef(0F, -165F, 0F); 65 | GlStateManager.disableLighting(); 66 | this.setRotationAngles(limbSwing, limbSwingAmount, rotateFloat, rotateYaw, rotatePitch, scale, entity); 67 | this.top1.render(scale); 68 | this.top2.render(scale); 69 | this.top3.render(scale); 70 | // this.top3.setTextureOffset(120, 0); 71 | // this.top2.offsetY=0F; 72 | // this.top1.rotationPointX=0F; 73 | // this.leg1.setRotationPoint(0, 0, 0); 74 | // setRotation(leg1, 0F,0.4F,1.2F); 75 | // leg1.mirror = true; 76 | this.leg1.render(scale); 77 | this.leg1.offsetX = 3F; 78 | this.leg2.offsetX = 3F; 79 | this.leg3.offsetX = 3F; 80 | this.leg1.offsetY = 18F; 81 | this.leg2.offsetY = 18F; 82 | this.leg3.offsetY = 18F; 83 | this.leg1.offsetZ = -2F; 84 | this.leg2.offsetZ = -2F; 85 | this.leg3.offsetZ = -2F; 86 | // this.leg2.setRotationPoint(0, 0, 0); 87 | // setRotation(leg2, 0F, 0.4F, 1.9F); 88 | this.leg2.render(scale); 89 | // this.leg3.setRotationPoint(0, 0, 0); 90 | // setRotation(leg3, 0F,-0.4F, 1.6F); 91 | this.leg3.render(scale); 92 | GlStateManager.enableLighting(); 93 | 94 | } 95 | 96 | @Override 97 | public void setRotationAngles(float limbSwing, float limbSwingAmount, float rotateFloat, float rotateYaw, 98 | float rotatePitch, float scale, Entity entity) { 99 | this.top1.rotateAngleY = (float) ((rotateYaw % 360) / 360 * 2 * Math.PI); 100 | this.top2.rotateAngleY = (float) ((rotateYaw % 360) / 360 * 2 * Math.PI); 101 | this.top3.rotateAngleY = (float) ((rotateYaw % 360) / 360 * 2 * Math.PI); 102 | } 103 | 104 | private void setRotation(ModelRenderer model, float x, float y, float z) { 105 | model.rotateAngleX = x; 106 | model.rotateAngleY = y; 107 | model.rotateAngleZ = z; 108 | } 109 | } 110 | -------------------------------------------------------------------------------- /src/main/java/com/porpit/minecamera/client/entity/render/RenderEntityTripod.java: -------------------------------------------------------------------------------- 1 | package com.porpit.minecamera.client.entity.render; 2 | 3 | import com.porpit.minecamera.MineCamera; 4 | import com.porpit.minecamera.client.entity.model.ModelEntityTripod; 5 | import com.porpit.minecamera.entity.EntityTripod; 6 | 7 | import net.minecraft.client.renderer.GlStateManager; 8 | import net.minecraft.client.renderer.entity.Render; 9 | import net.minecraft.client.renderer.entity.RenderManager; 10 | import net.minecraft.util.ResourceLocation; 11 | 12 | public class RenderEntityTripod extends Render { 13 | private static final ResourceLocation TRIPOD_TEXTURE = new ResourceLocation( 14 | MineCamera.MODID + ":" + "textures/entity/tripod.png"); 15 | private ModelEntityTripod model = new ModelEntityTripod(); 16 | 17 | public RenderEntityTripod(RenderManager renderManager) { 18 | super(renderManager); 19 | } 20 | 21 | @Override 22 | protected ResourceLocation getEntityTexture(EntityTripod entity) { 23 | return RenderEntityTripod.TRIPOD_TEXTURE; 24 | } 25 | 26 | @Override 27 | public void doRender(EntityTripod entity, double x, double y, double z, float entityYaw, float partialTicks) { 28 | GlStateManager.pushMatrix(); 29 | this.bindEntityTexture(entity); 30 | GlStateManager.translate((float) x, (float) y, (float) z); 31 | // GL11.glScalef(0.1F, 0.1F, 0.1F); 32 | GlStateManager.rotate(180.0F, 1.0F, 0.0F, 0.0F); 33 | model.render(entity, 0F, 0F, 0F, entityYaw, 0F, 0.5F); 34 | GlStateManager.popMatrix(); 35 | super.doRender(entity, x, y, z, entityYaw, partialTicks); 36 | } 37 | } -------------------------------------------------------------------------------- /src/main/java/com/porpit/minecamera/client/gui/GuiCamera.java: -------------------------------------------------------------------------------- 1 | package com.porpit.minecamera.client.gui; 2 | 3 | import com.porpit.minecamera.MineCamera; 4 | import com.porpit.minecamera.inventory.ContainerCamera; 5 | import com.porpit.minecamera.util.PictureFactory; 6 | 7 | import net.minecraft.client.Minecraft; 8 | import net.minecraft.client.gui.GuiButton; 9 | import net.minecraft.client.gui.inventory.GuiContainer; 10 | import net.minecraft.client.renderer.GlStateManager; 11 | import net.minecraft.client.resources.I18n; 12 | import net.minecraft.util.ResourceLocation; 13 | import net.minecraft.util.text.TextFormatting; 14 | import net.minecraftforge.fml.relauncher.Side; 15 | import net.minecraftforge.fml.relauncher.SideOnly; 16 | 17 | @SideOnly(Side.CLIENT) 18 | public class GuiCamera extends GuiContainer { 19 | private static final int BUTTON_PLUS = 0; 20 | private static final int BUTTON_MINUS = 1; 21 | private static final String TEXTURE_PATH = MineCamera.MODID + ":" + "textures/gui/container/gui_camera.png"; 22 | private static final ResourceLocation TEXTURE = new ResourceLocation(TEXTURE_PATH); 23 | protected int totalBurnTime; 24 | private String info; 25 | private ContainerCamera inventory; 26 | private int type; 27 | 28 | public GuiCamera(ContainerCamera inventorySlotsIn) { 29 | super(inventorySlotsIn); 30 | this.type = inventorySlotsIn.getType(); 31 | this.xSize = 176; 32 | this.ySize = 133; 33 | this.inventory = inventorySlotsIn; 34 | this.totalBurnTime = inventorySlotsIn.getTotalBurnTime(); 35 | } 36 | 37 | @Override 38 | public void initGui() { 39 | super.initGui(); 40 | // System.out.println("gui init"); 41 | if (type == 1) { 42 | int offsetX = (this.width - this.xSize) / 2, offsetY = (this.height - this.ySize) / 2; 43 | this.buttonList.add(new GuiButton(BUTTON_PLUS, offsetX + 29, offsetY + 5, 15, 13, "") { 44 | @Override 45 | public void drawButton(Minecraft mc, int mouseX, int mouseY, float partialTicks) { 46 | if (this.visible) { 47 | GlStateManager.color(1.0F, 1.0F, 1.0F); 48 | mc.getTextureManager().bindTexture(TEXTURE); 49 | int x = mouseX - this.x, y = mouseY - this.y; 50 | if (x >= 0 && y >= 0 && x < this.width && y < this.height) { 51 | this.drawTexturedModalRect(this.x, this.y, 39, 133, this.width, this.height); 52 | } else { 53 | this.drawTexturedModalRect(this.x, this.y, 24, 133, this.width, this.height); 54 | } 55 | } 56 | } 57 | 58 | @Override 59 | public void mouseReleased(int mouseX, int mouseY) { 60 | if (inventory.getDelay() >= 5) 61 | inventory.setDelay(inventory.getDelay() + 5); 62 | else { 63 | inventory.setDelay(inventory.getDelay() + 1); 64 | } 65 | } 66 | }); 67 | this.buttonList.add(new GuiButton(BUTTON_MINUS, offsetX + 61, offsetY + 5, 15, 13, "") { 68 | @Override 69 | public void drawButton(Minecraft mc, int mouseX, int mouseY, float partialTicks) { 70 | if (this.visible) { 71 | GlStateManager.color(1.0F, 1.0F, 1.0F); 72 | mc.getTextureManager().bindTexture(TEXTURE); 73 | int x = mouseX - this.x, y = mouseY - this.y; 74 | 75 | if (x >= 0 && y >= 0 && x < this.width && y < this.height) { 76 | this.drawTexturedModalRect(this.x, this.y, 69, 133, this.width, this.height); 77 | } else { 78 | this.drawTexturedModalRect(this.x, this.y, 54, 133, this.width, this.height); 79 | } 80 | } 81 | } 82 | 83 | @Override 84 | public void mouseReleased(int mouseX, int mouseY) { 85 | if (inventory.getDelay() > 5) { 86 | inventory.setDelay(inventory.getDelay() - 5); 87 | } else { 88 | inventory.setDelay(inventory.getDelay() - 1); 89 | } 90 | } 91 | }); 92 | } 93 | } 94 | 95 | @Override 96 | public void drawScreen(int mouseX, int mouseY, float partialTicks) 97 | { 98 | this.drawDefaultBackground(); 99 | super.drawScreen(mouseX, mouseY, partialTicks); 100 | this.renderHoveredToolTip(mouseX, mouseY); 101 | } 102 | 103 | @Override 104 | protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY) { 105 | 106 | GlStateManager.color(1.0F, 1.0F, 1.0F); 107 | this.mc.getTextureManager().bindTexture(TEXTURE); 108 | int offsetX = (this.width - this.xSize) / 2, offsetY = (this.height - this.ySize) / 2; 109 | this.drawTexturedModalRect(offsetX, offsetY, 0, 0, this.xSize, this.ySize); 110 | 111 | PictureFactory.drawDonateImage(this, mouseX, mouseY); 112 | } 113 | 114 | @Override 115 | protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) { 116 | this.mc.getTextureManager().bindTexture(TEXTURE); 117 | int burnTime = this.inventory.getBurnTime(); 118 | int textureWidth; 119 | if (burnTime >= this.totalBurnTime) { 120 | textureWidth = 0; 121 | info = null; 122 | } else { 123 | textureWidth = (int) (25.0 * burnTime / this.totalBurnTime); 124 | this.drawTexturedModalRect(94, 20, 0, 133, textureWidth, 15); 125 | info = I18n.format("container.camera.text.outing"); 126 | } 127 | if (type == 1) { 128 | this.drawTexturedModalRect(47, 6, 84, 133, 11, 11); 129 | this.fontRenderer.drawString(TextFormatting.GREEN + I18n.format("container.camera.text.delay"), 6, 7, 130 | 0x191970); 131 | int delaysecond = inventory.getDelay(); 132 | this.fontRenderer.drawString(delaysecond + "s", 48, 7, 0x191970); 133 | } 134 | if (info != null) { 135 | this.fontRenderer.drawString(info, 94, 39, 0xD3D3D3); 136 | } 137 | } 138 | } 139 | -------------------------------------------------------------------------------- /src/main/java/com/porpit/minecamera/client/gui/GuiPhotoProcessor.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PorPit/MineCamera/d52eb883f2af9a8f66cf183060898c7672c9a471/src/main/java/com/porpit/minecamera/client/gui/GuiPhotoProcessor.java -------------------------------------------------------------------------------- /src/main/java/com/porpit/minecamera/client/gui/GuiPictureBook.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PorPit/MineCamera/d52eb883f2af9a8f66cf183060898c7672c9a471/src/main/java/com/porpit/minecamera/client/gui/GuiPictureBook.java -------------------------------------------------------------------------------- /src/main/java/com/porpit/minecamera/client/tilerender/PictureFrameMultipleTileRenderer.java: -------------------------------------------------------------------------------- 1 | package com.porpit.minecamera.client.tilerender; 2 | 3 | import org.lwjgl.opengl.GL11; 4 | 5 | import com.porpit.minecamera.block.BlockPictureFrame.EnumStateType; 6 | import com.porpit.minecamera.tileentity.TileEntityPictureFrame; 7 | import com.porpit.minecamera.tileentity.TileEntityPictureFrameMultiple; 8 | import com.porpit.minecamera.util.PictureFactory; 9 | 10 | import net.minecraft.client.Minecraft; 11 | import net.minecraft.client.renderer.GlStateManager; 12 | import net.minecraft.client.renderer.OpenGlHelper; 13 | import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; 14 | import net.minecraft.util.EnumFacing; 15 | 16 | public class PictureFrameMultipleTileRenderer extends TileEntitySpecialRenderer { 17 | @Override 18 | public void render(TileEntityPictureFrameMultiple frame, double x, double y, double z, float partialTicks, int destroyStage, float alpha) { 19 | if (frame.shouldrender) { 20 | // 1:normal 2:failtoload 3:loding 21 | int rendertype = 0; 22 | if (frame.istextureLoaded()) { 23 | if (frame.textureID != -1) { 24 | rendertype = 1; 25 | } 26 | } else { 27 | if (frame.hasImageName()) { 28 | if (frame.canLoadImage()) { 29 | frame.loadImage(); 30 | } 31 | if (frame.isFailed()) { 32 | rendertype = 2; 33 | } else { 34 | rendertype = 3; 35 | } 36 | } 37 | } 38 | //render 39 | if (rendertype > 0) { 40 | boolean flippedX = false; 41 | boolean flippedY = false; 42 | GlStateManager.enableBlend(); 43 | OpenGlHelper.glBlendFunc(770, 771, 1, 0); 44 | GlStateManager.disableLighting(); 45 | GlStateManager.color(1, 1, 1, 1); 46 | 47 | switch (rendertype) { 48 | case 1: 49 | GlStateManager.bindTexture(frame.textureID); 50 | break; 51 | case 2: 52 | Minecraft.getMinecraft().getTextureManager().bindTexture(PictureFactory.FailToLoadImage); 53 | break; 54 | case 3: 55 | Minecraft.getMinecraft().getTextureManager().bindTexture(PictureFactory.LODINGIMAGE); 56 | break; 57 | default: 58 | return; 59 | } 60 | 61 | GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, GL11.GL_NEAREST); 62 | GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_NEAREST); 63 | 64 | GlStateManager.pushMatrix(); 65 | GL11.glTranslated(x + 0.5, y + 0.5, z + 0.5); 66 | 67 | EnumFacing direction = EnumFacing.getFront(frame.getBlockMetadata() & 3); 68 | EnumStateType stateType = EnumStateType.HANDGING; 69 | applyDirection(direction); 70 | GlStateManager.enableRescaleNormal(); 71 | GL11.glTranslated(0, (frame.height - 1) * 0.5, (frame.width - 1) * -0.5); 72 | GL11.glScaled(1, frame.height - 0.4, frame.width - 0.4); 73 | GL11.glTranslated(-0.93, 0, 0); 74 | 75 | GL11.glBegin(GL11.GL_POLYGON); 76 | GL11.glNormal3f(1.0f, 0.0F, 0.0f); 77 | 78 | GL11.glTexCoord3f(flippedY ? 0 : 1, flippedX ? 0 : 1, 0); 79 | GL11.glVertex3f(0.5F, -0.5f, -0.5f); 80 | GL11.glTexCoord3f(flippedY ? 0 : 1, flippedX ? 1 : 0, 0); 81 | GL11.glVertex3f(0.5f, 0.5f, -0.5f); 82 | GL11.glTexCoord3f(flippedY ? 1 : 0, flippedX ? 1 : 0, 0); 83 | GL11.glVertex3f(0.5f, 0.5f, 0.5f); 84 | GL11.glTexCoord3f(flippedY ? 1 : 0, flippedX ? 0 : 1, 0); 85 | GL11.glVertex3f(0.5f, -0.5f, 0.5f); 86 | GL11.glEnd(); 87 | GlStateManager.popMatrix(); 88 | 89 | GlStateManager.disableRescaleNormal(); 90 | GlStateManager.disableBlend(); 91 | GlStateManager.enableLighting(); 92 | } 93 | } 94 | } 95 | 96 | @Override 97 | public boolean isGlobalRenderer(TileEntityPictureFrameMultiple te) { 98 | return true; 99 | } 100 | 101 | public static void applyDirection(EnumFacing direction) { 102 | int rotation = 0; 103 | switch (direction.getIndex()) { 104 | case 0: 105 | rotation = 270; 106 | break; 107 | case 1: 108 | rotation = 180; 109 | break; 110 | case 2: 111 | rotation = 90; 112 | break; 113 | case 3: 114 | rotation = 0; 115 | break; 116 | default: 117 | break; 118 | } 119 | GL11.glRotated(rotation, 0, 1, 0); 120 | } 121 | } 122 | -------------------------------------------------------------------------------- /src/main/java/com/porpit/minecamera/client/tilerender/PictureFrameTileRenderer.java: -------------------------------------------------------------------------------- 1 | package com.porpit.minecamera.client.tilerender; 2 | 3 | import org.lwjgl.opengl.GL11; 4 | 5 | import com.porpit.minecamera.block.BlockPictureFrame.EnumStateType; 6 | import com.porpit.minecamera.tileentity.TileEntityPictureFrame; 7 | import com.porpit.minecamera.util.PictureFactory; 8 | 9 | import net.minecraft.client.Minecraft; 10 | import net.minecraft.client.renderer.GlStateManager; 11 | import net.minecraft.client.renderer.OpenGlHelper; 12 | import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; 13 | import net.minecraft.util.EnumFacing; 14 | 15 | public class PictureFrameTileRenderer extends TileEntitySpecialRenderer { 16 | @Override 17 | public void render(TileEntityPictureFrame frame, double x, double y, double z, float partialTicks, int destroyStage, float alpha) { 18 | // 1:normal 2:failtoload 3:loding 19 | int rendertype = 0; 20 | if (frame.istextureLoaded()) { 21 | if (frame.textureID != -1) { 22 | rendertype = 1; 23 | } 24 | } else { 25 | if (frame.hasImageName()) { 26 | if (frame.canLoadImage()) { 27 | frame.loadImage(); 28 | } 29 | if (frame.isFailed()) { 30 | rendertype = 2; 31 | } else { 32 | rendertype = 3; 33 | } 34 | } 35 | } 36 | // render 37 | if (rendertype > 0) { 38 | boolean flippedX = false; 39 | boolean flippedY = false; 40 | GlStateManager.enableBlend(); 41 | OpenGlHelper.glBlendFunc(770, 771, 1, 0); 42 | GlStateManager.disableLighting(); 43 | GlStateManager.color(1, 1, 1, 1); 44 | 45 | switch (rendertype) { 46 | case 1: 47 | GlStateManager.bindTexture(frame.textureID); 48 | break; 49 | case 2: 50 | Minecraft.getMinecraft().getTextureManager().bindTexture(PictureFactory.FailToLoadImage); 51 | break; 52 | case 3: 53 | Minecraft.getMinecraft().getTextureManager().bindTexture(PictureFactory.LODINGIMAGE); 54 | break; 55 | default: 56 | return; 57 | } 58 | 59 | GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, GL11.GL_NEAREST); 60 | GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_NEAREST); 61 | 62 | GlStateManager.pushMatrix(); 63 | GL11.glTranslated(x + 0.5, y + 0.5, z + 0.5); 64 | 65 | EnumFacing direction = EnumFacing.getFront(frame.getBlockMetadata() & 3); 66 | EnumStateType stateType = EnumStateType.values()[frame.getBlockMetadata() >> 2]; 67 | applyDirection(direction); 68 | GlStateManager.enableRescaleNormal(); 69 | if (stateType.equals(EnumStateType.HANDGING)) { 70 | GL11.glTranslated(-0.93, 0, 0); 71 | GL11.glScaled(1, 0.60, 0.9); 72 | } else { 73 | GL11.glTranslated(-0.50, -0.2, 0); 74 | GL11.glScaled(1, 0.60, 0.9); 75 | GL11.glRotatef(14F, 0F, 0F, 1F); 76 | } 77 | 78 | GL11.glBegin(GL11.GL_POLYGON); 79 | GL11.glNormal3f(1.0f, 0.0F, 0.0f); 80 | 81 | GL11.glTexCoord3f(flippedY ? 0 : 1, flippedX ? 0 : 1, 0); 82 | GL11.glVertex3f(0.5F, -0.5f, -0.5f); 83 | GL11.glTexCoord3f(flippedY ? 0 : 1, flippedX ? 1 : 0, 0); 84 | GL11.glVertex3f(0.5f, 0.5f, -0.5f); 85 | GL11.glTexCoord3f(flippedY ? 1 : 0, flippedX ? 1 : 0, 0); 86 | GL11.glVertex3f(0.5f, 0.5f, 0.5f); 87 | GL11.glTexCoord3f(flippedY ? 1 : 0, flippedX ? 0 : 1, 0); 88 | GL11.glVertex3f(0.5f, -0.5f, 0.5f); 89 | GL11.glEnd(); 90 | GlStateManager.popMatrix(); 91 | 92 | GlStateManager.disableRescaleNormal(); 93 | GlStateManager.disableBlend(); 94 | GlStateManager.enableLighting(); 95 | } 96 | } 97 | 98 | @Override 99 | public boolean isGlobalRenderer(TileEntityPictureFrame te) { 100 | return false; 101 | } 102 | 103 | public static void applyDirection(EnumFacing direction) { 104 | int rotation = 0; 105 | switch (direction.getIndex()) { 106 | case 0: 107 | rotation = 270; 108 | break; 109 | case 1: 110 | rotation = 180; 111 | break; 112 | case 2: 113 | rotation = 90; 114 | break; 115 | case 3: 116 | rotation = 0; 117 | break; 118 | default: 119 | break; 120 | } 121 | GL11.glRotated(rotation, 0, 1, 0); 122 | } 123 | } 124 | -------------------------------------------------------------------------------- /src/main/java/com/porpit/minecamera/client/tilerender/TileRenderLoader.java: -------------------------------------------------------------------------------- 1 | package com.porpit.minecamera.client.tilerender; 2 | 3 | import com.porpit.minecamera.client.entity.render.RenderEntityTripod; 4 | import com.porpit.minecamera.entity.EntityTripod; 5 | import com.porpit.minecamera.tileentity.TileEntityPictureFrame; 6 | import com.porpit.minecamera.tileentity.TileEntityPictureFrameMultiple; 7 | 8 | import net.minecraftforge.fml.client.registry.ClientRegistry; 9 | import net.minecraftforge.fml.relauncher.Side; 10 | import net.minecraftforge.fml.relauncher.SideOnly; 11 | 12 | public class TileRenderLoader { 13 | public TileRenderLoader() { 14 | registerRenders(); 15 | } 16 | 17 | @SideOnly(Side.CLIENT) 18 | public static void registerRenders() { 19 | ClientRegistry.bindTileEntitySpecialRenderer(TileEntityPictureFrame.class, new PictureFrameTileRenderer()); 20 | ClientRegistry.bindTileEntitySpecialRenderer(TileEntityPictureFrameMultiple.class, new PictureFrameMultipleTileRenderer()); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/com/porpit/minecamera/common/CommonProxy.java: -------------------------------------------------------------------------------- 1 | package com.porpit.minecamera.common; 2 | 3 | import com.porpit.minecamera.block.BlockLoader; 4 | import com.porpit.minecamera.creativetab.CreativeTabsLoader; 5 | import com.porpit.minecamera.entity.EntityLoader; 6 | import com.porpit.minecamera.inventory.GuiElementLoader; 7 | import com.porpit.minecamera.item.ItemLoader; 8 | import com.porpit.minecamera.network.NetworkLoader; 9 | import com.porpit.minecamera.tileentity.TileEntityLoader; 10 | 11 | import net.minecraftforge.common.DimensionManager; 12 | import net.minecraftforge.fml.common.event.FMLInitializationEvent; 13 | import net.minecraftforge.fml.common.event.FMLPostInitializationEvent; 14 | import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; 15 | import net.minecraftforge.fml.common.event.FMLServerStartingEvent; 16 | import net.minecraftforge.fml.relauncher.Side; 17 | import net.minecraftforge.fml.relauncher.SideOnly; 18 | 19 | public class CommonProxy { 20 | public void preInit(FMLPreInitializationEvent event) { 21 | new CreativeTabsLoader(event); 22 | new BlockLoader(event); 23 | new ItemLoader(event); 24 | new TileEntityLoader(event); 25 | new EventLoader(); 26 | new NetworkLoader(event); 27 | new GuiElementLoader(); 28 | new EntityLoader(); 29 | 30 | //TODO 31 | /* 32 | * new CraftingLoader(); 33 | * new AchievementLoader();*/ 34 | } 35 | 36 | public void init(FMLInitializationEvent event) { 37 | 38 | } 39 | 40 | public void postInit(FMLPostInitializationEvent event) { 41 | 42 | } 43 | 44 | public void serverStarting(FMLServerStartingEvent event) { 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/main/java/com/porpit/minecamera/common/EventLoader.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PorPit/MineCamera/d52eb883f2af9a8f66cf183060898c7672c9a471/src/main/java/com/porpit/minecamera/common/EventLoader.java -------------------------------------------------------------------------------- /src/main/java/com/porpit/minecamera/creativetab/CreativeTabsLoader.java: -------------------------------------------------------------------------------- 1 | package com.porpit.minecamera.creativetab; 2 | 3 | import net.minecraft.creativetab.CreativeTabs; 4 | import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; 5 | 6 | public class CreativeTabsLoader { 7 | public static CreativeTabs tabMineCamera; 8 | 9 | public CreativeTabsLoader(FMLPreInitializationEvent event) { 10 | tabMineCamera = new CreativeTabsMineCamera(); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/com/porpit/minecamera/creativetab/CreativeTabsMineCamera.java: -------------------------------------------------------------------------------- 1 | package com.porpit.minecamera.creativetab; 2 | 3 | import com.porpit.minecamera.item.ItemLoader; 4 | 5 | import net.minecraft.creativetab.CreativeTabs; 6 | import net.minecraft.item.Item; 7 | import net.minecraft.item.ItemStack; 8 | 9 | public class CreativeTabsMineCamera extends CreativeTabs { 10 | public CreativeTabsMineCamera() { 11 | super("minecamera"); 12 | this.setBackgroundImageName("minecamera.png"); 13 | } 14 | 15 | @Override 16 | public ItemStack getTabIconItem() { 17 | return new ItemStack(ItemLoader.itemCamera); 18 | } 19 | 20 | @Override 21 | public boolean hasSearchBar() { 22 | return true; 23 | } 24 | } -------------------------------------------------------------------------------- /src/main/java/com/porpit/minecamera/entity/EntityLoader.java: -------------------------------------------------------------------------------- 1 | package com.porpit.minecamera.entity; 2 | 3 | import com.porpit.minecamera.MineCamera; 4 | import com.porpit.minecamera.client.entity.EntityRenderFactory; 5 | import com.porpit.minecamera.client.entity.render.RenderEntityTripod; 6 | 7 | import net.minecraft.client.renderer.entity.Render; 8 | import net.minecraft.entity.Entity; 9 | import net.minecraft.util.ResourceLocation; 10 | import net.minecraftforge.fml.client.registry.RenderingRegistry; 11 | import net.minecraftforge.fml.common.registry.EntityRegistry; 12 | import net.minecraftforge.fml.relauncher.Side; 13 | import net.minecraftforge.fml.relauncher.SideOnly; 14 | 15 | public class EntityLoader { 16 | private static int nextID = 0; 17 | 18 | public EntityLoader() { 19 | registerEntity(EntityTripod.class, "Tripod", 80, 3, true); 20 | } 21 | 22 | private static void registerEntity(Class entityClass, String name, int trackingRange, 23 | int updateFrequency, boolean sendsVelocityUpdates) { 24 | EntityRegistry.registerModEntity(new ResourceLocation(MineCamera.MODID+":tripod"),entityClass, name, nextID++, MineCamera.instance, trackingRange, 25 | updateFrequency, sendsVelocityUpdates); 26 | } 27 | 28 | @SideOnly(Side.CLIENT) 29 | public static void registerRenders() { 30 | registerEntityRender(EntityTripod.class, RenderEntityTripod.class); 31 | } 32 | 33 | @SideOnly(Side.CLIENT) 34 | private static void registerEntityRender(Class entityClass, 35 | Class> render) { 36 | RenderingRegistry.registerEntityRenderingHandler(entityClass, new EntityRenderFactory(render)); 37 | } 38 | } -------------------------------------------------------------------------------- /src/main/java/com/porpit/minecamera/entity/EntityTripod.java: -------------------------------------------------------------------------------- 1 | package com.porpit.minecamera.entity; 2 | 3 | import javax.annotation.Nullable; 4 | 5 | import com.porpit.minecamera.inventory.ContainerCamera; 6 | import com.porpit.minecamera.item.ItemLoader; 7 | import com.porpit.minecamera.network.MessageUpdatePitchYaw; 8 | import com.porpit.minecamera.network.NetworkLoader; 9 | 10 | import net.minecraft.block.Block; 11 | import net.minecraft.block.SoundType; 12 | import net.minecraft.block.material.Material; 13 | import net.minecraft.block.state.IBlockState; 14 | import net.minecraft.client.Minecraft; 15 | import net.minecraft.client.entity.EntityPlayerSP; 16 | import net.minecraft.entity.Entity; 17 | import net.minecraft.entity.player.EntityPlayer; 18 | import net.minecraft.init.MobEffects; 19 | import net.minecraft.item.ItemStack; 20 | import net.minecraft.nbt.NBTTagCompound; 21 | import net.minecraft.potion.PotionEffect; 22 | import net.minecraft.util.DamageSource; 23 | import net.minecraft.util.EnumActionResult; 24 | import net.minecraft.util.EnumFacing; 25 | import net.minecraft.util.EnumHand; 26 | import net.minecraft.util.EnumParticleTypes; 27 | import net.minecraft.util.math.AxisAlignedBB; 28 | import net.minecraft.util.math.BlockPos; 29 | import net.minecraft.util.math.MathHelper; 30 | import net.minecraft.util.math.Vec3d; 31 | import net.minecraft.world.World; 32 | import net.minecraft.world.WorldServer; 33 | import net.minecraftforge.common.capabilities.Capability; 34 | import net.minecraftforge.fml.relauncher.Side; 35 | import net.minecraftforge.fml.relauncher.SideOnly; 36 | import net.minecraftforge.items.CapabilityItemHandler; 37 | import net.minecraftforge.items.IItemHandlerModifiable; 38 | import net.minecraftforge.items.ItemStackHandler; 39 | 40 | public class EntityTripod extends Entity { 41 | public static boolean islock = false; 42 | protected ItemStackHandler Inventory = new ItemStackHandler(4){ 43 | @Override 44 | public int getSlotLimit(int slot) { 45 | return 1; 46 | } 47 | }; 48 | private int burnTime; 49 | private int delay = 0; 50 | private int timer; 51 | 52 | public EntityTripod(World worldIn) { 53 | super(worldIn); 54 | this.delay = 0; 55 | this.setBurnTime(ContainerCamera.totalBurnTime); 56 | this.preventEntitySpawning = true; 57 | this.setSize(1F, 2); 58 | } 59 | 60 | @Override 61 | protected void entityInit() { 62 | } 63 | 64 | @Override 65 | public boolean hasCapability(Capability capability, EnumFacing facing) { 66 | if (CapabilityItemHandler.ITEM_HANDLER_CAPABILITY.equals(capability)) { 67 | return true; 68 | } 69 | 70 | return super.hasCapability(capability, facing); 71 | } 72 | 73 | @Override 74 | public T getCapability(Capability capability, EnumFacing facing) { 75 | if (CapabilityItemHandler.ITEM_HANDLER_CAPABILITY.equals(capability)) { 76 | @SuppressWarnings("unchecked") 77 | T result = (T) Inventory; 78 | return result; 79 | } 80 | return super.getCapability(capability, facing); 81 | } 82 | 83 | @Override 84 | public void setPosition(double x, double y, double z) { 85 | this.posX = x; 86 | this.posY = y; 87 | this.posZ = z; 88 | this.setEntityBoundingBox(new AxisAlignedBB(x - 0.5, y, z - 0.5, x + 0.5, y + 2.5, z + 0.5)); 89 | } 90 | 91 | @SideOnly(Side.CLIENT) 92 | public AxisAlignedBB getRenderBoundingBox() { 93 | AxisAlignedBB axisalignedbb = this.getEntityBoundingBox(); 94 | return axisalignedbb; 95 | } 96 | 97 | /* @Override 98 | protected void updateFallState(double y, boolean onGroundIn, IBlockState state, BlockPos pos) { 99 | if (!this.isInWater()) 100 | { 101 | this.handleWaterMovement(); 102 | } 103 | 104 | if (!this.world.isRemote && this.fallDistance > 3.0F && onGroundIn) 105 | { 106 | float f = (float)MathHelper.ceiling_float_int(this.fallDistance - 3.0F); 107 | 108 | if (!state.getBlock().isAir(state, world, pos)) 109 | { 110 | double d0 = Math.min((double)(0.2F + f / 15.0F), 2.5D); 111 | int i = (int)(150.0D * d0); 112 | } 113 | } 114 | 115 | super.updateFallState(y, onGroundIn, state, pos); 116 | }*/ 117 | 118 | @Override 119 | public boolean canBeCollidedWith() { 120 | return true; 121 | } 122 | 123 | /* @Override 124 | public void fall(float distance, float damageMultiplier) 125 | { 126 | super.fall(distance, damageMultiplier); 127 | int i = MathHelper.ceiling_float_int((distance - 3.0F) * damageMultiplier); 128 | 129 | if (i > 0) 130 | { 131 | this.attackEntityFrom(DamageSource.fall, (float)i); 132 | int j = MathHelper.floor_double(this.posX); 133 | int k = MathHelper.floor_double(this.posY - 0.20000000298023224D); 134 | int l = MathHelper.floor_double(this.posZ); 135 | IBlockState iblockstate = this.world.getBlockState(new BlockPos(j, k, l)); 136 | 137 | if (iblockstate.getMaterial() != Material.AIR) 138 | { 139 | SoundType soundtype = iblockstate.getBlock().getSoundType(iblockstate, world, new BlockPos(j, k, l), this); 140 | this.playSound(soundtype.getFallSound(), soundtype.getVolume() * 0.5F, soundtype.getPitch() * 0.75F); 141 | } 142 | } 143 | }*/ 144 | 145 | 146 | @Override 147 | public void onUpdate() { 148 | super.onUpdate(); 149 | // System.out.println((this.getEntityWorld().isRemote?"Client":"Server")+":"+this.burnTime); 150 | if (this.getEntityWorld().isRemote && !islock && Minecraft.getMinecraft().getRenderViewEntity().equals(this)) { 151 | EntityPlayerSP player = Minecraft.getMinecraft().player; 152 | this.rotationYaw = this.rotationYaw += player.rotationYaw - player.prevRotationYawHead; 153 | this.rotationPitch = player.rotationPitch; 154 | player.rotationYaw = player.prevRotationYawHead; 155 | player.rotationYawHead = player.prevRotationYawHead; 156 | player.rotationPitch = player.prevRotationPitch; 157 | if (this.timer == 0) { 158 | MessageUpdatePitchYaw message = new MessageUpdatePitchYaw(); 159 | message.rotationYaw = this.rotationYaw; 160 | message.rotationPitch = this.rotationPitch; 161 | NetworkLoader.instance.sendToServer(message); 162 | } 163 | this.timer++; 164 | if (timer >= 30) { 165 | timer = 0; 166 | } 167 | } 168 | } 169 | 170 | @Override 171 | public boolean hitByEntity(Entity entityIn) { 172 | this.setDead(); 173 | return false; 174 | } 175 | 176 | @Override 177 | public void setDead() { 178 | //System.out.println("death and drop"); 179 | if (!this.getEntityWorld().isRemote) { 180 | Block.spawnAsEntity(this.getEntityWorld(), this.getPosition(), new ItemStack(ItemLoader.itemTripod, 1)); 181 | // last slot useless,so= -2 !=-1 182 | for (int i = Inventory.getSlots() - 2; i >= 0; --i) { 183 | if (Inventory.getStackInSlot(i) != null) { 184 | Block.spawnAsEntity(this.getEntityWorld(), this.getPosition(), Inventory.getStackInSlot(i)); 185 | ((IItemHandlerModifiable) Inventory).setStackInSlot(i, ItemStack.EMPTY); 186 | } 187 | } 188 | } 189 | super.setDead(); 190 | } 191 | 192 | @Nullable 193 | public AxisAlignedBB getCollisionBox(Entity entityIn) { 194 | //System.out.println(entityIn.getPosition()); 195 | return new AxisAlignedBB(entityIn.getPosition().getX() - 0.5, entityIn.getPosition().getY() - 0.5, 196 | entityIn.getPosition().getZ() - 0.5, entityIn.getPosition().getX() + 0.5, 197 | entityIn.getPosition().getY() + 2, entityIn.getPosition().getZ() + 0.5); 198 | } 199 | 200 | @Override 201 | public boolean processInitialInteract(EntityPlayer player, EnumHand hand) { 202 | this.timer = 90; 203 | return false; 204 | } 205 | 206 | @Override 207 | public float getEyeHeight() { 208 | return 2.5F; 209 | } 210 | 211 | /*@Override 212 | public EnumActionResult applyPlayerInteraction(EntityPlayer player, Vec3d vec, EnumHand stack) { 213 | return EnumActionResult.PASS; 214 | }*/ 215 | 216 | public int getDelay() { 217 | return delay; 218 | } 219 | 220 | public void setDelay(int delay) { 221 | this.delay = delay; 222 | } 223 | 224 | @Override 225 | protected void readEntityFromNBT(NBTTagCompound compound) { 226 | this.delay = compound.getInteger("delay"); 227 | this.burnTime = compound.getInteger("burnTime"); 228 | this.Inventory.deserializeNBT(compound.getCompoundTag("Inventory")); 229 | } 230 | 231 | @Override 232 | protected void writeEntityToNBT(NBTTagCompound compound) { 233 | compound.setInteger("delay", this.delay); 234 | compound.setInteger("burnTime", this.burnTime); 235 | compound.setTag("Inventory", this.Inventory.serializeNBT()); 236 | } 237 | 238 | public int getBurnTime() { 239 | return burnTime; 240 | } 241 | 242 | public void setBurnTime(int burnTime) { 243 | this.burnTime = burnTime; 244 | } 245 | 246 | } -------------------------------------------------------------------------------- /src/main/java/com/porpit/minecamera/inventory/ContainerPhotoProcessor.java: -------------------------------------------------------------------------------- 1 | package com.porpit.minecamera.inventory; 2 | 3 | import javax.annotation.Nullable; 4 | 5 | import com.porpit.minecamera.item.ItemLoader; 6 | import com.porpit.minecamera.tileentity.TileEntityPhotoProcessor; 7 | 8 | import net.minecraft.entity.player.EntityPlayer; 9 | import net.minecraft.init.Items; 10 | import net.minecraft.inventory.ClickType; 11 | import net.minecraft.inventory.Container; 12 | import net.minecraft.inventory.IContainerListener; 13 | import net.minecraft.inventory.Slot; 14 | import net.minecraft.item.ItemStack; 15 | import net.minecraft.tileentity.TileEntity; 16 | import net.minecraftforge.fml.relauncher.Side; 17 | import net.minecraftforge.fml.relauncher.SideOnly; 18 | import net.minecraftforge.items.CapabilityItemHandler; 19 | import net.minecraftforge.items.IItemHandler; 20 | import net.minecraftforge.items.SlotItemHandler; 21 | 22 | public class ContainerPhotoProcessor extends Container { 23 | 24 | protected IItemHandler AllSlot; 25 | public static int totalBurnTime = TileEntityPhotoProcessor.totalburnTime; 26 | protected int burnTime = totalBurnTime; 27 | // private ItemStackHandler items = new ItemStackHandler(5); 28 | protected EntityPlayer player; 29 | protected TileEntityPhotoProcessor tileEntity; 30 | 31 | public ContainerPhotoProcessor(EntityPlayer player, TileEntity tileEntity) { 32 | super(); 33 | this.tileEntity = (TileEntityPhotoProcessor) tileEntity; 34 | this.player = player; 35 | this.burnTime = this.tileEntity.getBurnTime(); 36 | // System.out.println(player.getEntityWorld().provider.getDimension()); 37 | AllSlot = tileEntity.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, player.getHorizontalFacing()); 38 | this.addSlotToContainer(new SlotItemHandler(AllSlot, 0, 9, 29) { 39 | @Override 40 | public boolean isItemValid(ItemStack stack) { 41 | return stack != null && stack.getItem() == ItemLoader.itemCntsTempLiquid && super.isItemValid(stack); 42 | } 43 | 44 | @Override 45 | public int getItemStackLimit(ItemStack stack) { 46 | return 10; 47 | } 48 | }); 49 | this.addSlotToContainer(new SlotItemHandler(AllSlot, 1, 9, 59) { 50 | @Override 51 | public boolean isItemValid(ItemStack stack) { 52 | return stack != null && stack.getItem() == ItemLoader.itemDevelopingAgent && super.isItemValid(stack); 53 | } 54 | 55 | @Override 56 | public int getItemStackLimit(ItemStack stack) { 57 | return 10; 58 | } 59 | }); 60 | this.addSlotToContainer(new SlotItemHandler(AllSlot, 2, 44, 101) { 61 | @Override 62 | public boolean isItemValid(ItemStack stack) { 63 | return stack != null && stack.getItem() == ItemLoader.itemFilm && super.isItemValid(stack); 64 | } 65 | 66 | @Override 67 | public int getItemStackLimit(ItemStack stack) { 68 | return 1; 69 | } 70 | }); 71 | this.addSlotToContainer(new SlotItemHandler(AllSlot, 3, 80, 101) { 72 | @Override 73 | public boolean isItemValid(ItemStack stack) { 74 | return stack != null && stack.getItem() == ItemLoader.itemPhotoPaper && super.isItemValid(stack); 75 | } 76 | 77 | @Override 78 | public int getItemStackLimit(ItemStack stack) { 79 | return 64; 80 | } 81 | }); 82 | this.addSlotToContainer(new SlotItemHandler(AllSlot, 4, 152, 101) { 83 | @Override 84 | public boolean isItemValid(ItemStack stack) { 85 | return false; 86 | } 87 | }); 88 | for (int i = 0; i < 3; ++i) { 89 | for (int j = 0; j < 9; ++j) { 90 | this.addSlotToContainer(new Slot(player.inventory, j + i * 9 + 9, 8 + j * 18, 124 + i * 18)); 91 | } 92 | } 93 | 94 | for (int i = 0; i < 9; ++i) { 95 | this.addSlotToContainer(new Slot(player.inventory, i, 8 + i * 18, 182)); 96 | } 97 | } 98 | 99 | @Override 100 | public void detectAndSendChanges() { 101 | super.detectAndSendChanges(); 102 | // System.out.println(tileEntity.getBurnTime()); 103 | for (IContainerListener i : this.listeners) { 104 | i.sendWindowProperty(this, 0, tileEntity.getBurnTime()); 105 | } 106 | 107 | } 108 | 109 | @SideOnly(Side.CLIENT) 110 | @Override 111 | public void updateProgressBar(int id, int data) { 112 | super.updateProgressBar(id, data); 113 | 114 | switch (id) { 115 | case 0: 116 | this.burnTime = data; 117 | break; 118 | default: 119 | break; 120 | } 121 | } 122 | 123 | public int getBurnTime() { 124 | return this.burnTime; 125 | } 126 | 127 | public TileEntityPhotoProcessor getTileEntity() { 128 | return tileEntity; 129 | } 130 | 131 | @Override 132 | public boolean canInteractWith(EntityPlayer playerIn) { 133 | return true; 134 | } 135 | 136 | @Override 137 | public ItemStack transferStackInSlot(EntityPlayer playerIn, int index) { 138 | ItemStack itemstack = ItemStack.EMPTY; 139 | Slot slot = this.inventorySlots.get(index); 140 | if (slot != null && slot.getHasStack()){ 141 | ItemStack itemstack1 = slot.getStack(); 142 | itemstack = itemstack1.copy(); 143 | if (index >= 0 && index <= 4) 144 | { 145 | if (!this.mergeItemStack(itemstack1, 5, 41, true)) { 146 | return ItemStack.EMPTY; 147 | } 148 | slot.onSlotChange(itemstack1, itemstack); 149 | 150 | }else if (index >= 5 && index < 32) 151 | { 152 | if (!this.mergeItemStack(itemstack1, 0, 4, false)) { 153 | return ItemStack.EMPTY; 154 | } 155 | }else if (index >= 32 && index < 41) 156 | { 157 | if (!this.mergeItemStack(itemstack1, 0, 4, false)) { 158 | return ItemStack.EMPTY; 159 | } 160 | } 161 | if (itemstack1.isEmpty()) { 162 | slot.putStack(ItemStack.EMPTY); 163 | } else { 164 | slot.onSlotChanged(); 165 | } 166 | 167 | if (itemstack1.getCount() == itemstack.getCount()) { 168 | return ItemStack.EMPTY; 169 | } 170 | 171 | slot.onTake(playerIn, itemstack1); 172 | } 173 | return itemstack; 174 | 175 | } 176 | 177 | @Override 178 | @Nullable 179 | public ItemStack slotClick(int slotId, int dragType, ClickType clickTypeIn, EntityPlayer player) { 180 | // System.out.println(slotId); 181 | return super.slotClick(slotId, dragType, clickTypeIn, player); 182 | } 183 | 184 | public EntityPlayer getPlayer() { 185 | return player; 186 | } 187 | } 188 | -------------------------------------------------------------------------------- /src/main/java/com/porpit/minecamera/inventory/ContainerPictureBook.java: -------------------------------------------------------------------------------- 1 | package com.porpit.minecamera.inventory; 2 | 3 | import java.util.ArrayList; 4 | import java.util.Arrays; 5 | import java.util.List; 6 | 7 | import javax.annotation.Nullable; 8 | 9 | import com.porpit.minecamera.item.ItemLoader; 10 | 11 | import net.minecraft.entity.player.EntityPlayer; 12 | import net.minecraft.init.Blocks; 13 | import net.minecraft.inventory.ClickType; 14 | import net.minecraft.inventory.Container; 15 | import net.minecraft.inventory.IContainerListener; 16 | import net.minecraft.inventory.Slot; 17 | import net.minecraft.item.ItemStack; 18 | import net.minecraft.nbt.NBTTagCompound; 19 | import net.minecraftforge.fml.relauncher.Side; 20 | import net.minecraftforge.fml.relauncher.SideOnly; 21 | import net.minecraftforge.items.IItemHandler; 22 | import net.minecraftforge.items.ItemStackHandler; 23 | import net.minecraftforge.items.SlotItemHandler; 24 | 25 | public class ContainerPictureBook extends Container { 26 | protected EntityPlayer player; 27 | protected Slot pictureInSlot; 28 | protected Slot pictureOutSlot; 29 | IItemHandler items = new ItemStackHandler(2){ 30 | @Override 31 | public int getSlotLimit(int slot) { 32 | return 1; 33 | } 34 | }; 35 | protected int index; 36 | protected int lastindex; 37 | protected int totalPictureNum; 38 | protected List listPid = new ArrayList(); 39 | 40 | public ContainerPictureBook(EntityPlayer player) { 41 | super(); 42 | this.player = player; 43 | this.index = 0; 44 | this.totalPictureNum = 0; 45 | this.addSlotToContainer(this.pictureInSlot = new SlotItemHandler(items, 0, 224, 10) { 46 | @Override 47 | public boolean isItemValid(ItemStack stack) { 48 | return stack != null && stack.getItem() == ItemLoader.itemPicture && super.isItemValid(stack); 49 | } 50 | 51 | @Override 52 | public int getItemStackLimit(ItemStack stack) { 53 | return 1; 54 | } 55 | }); 56 | 57 | this.addSlotToContainer(this.pictureOutSlot = new SlotItemHandler(items, 1, 224, 62) { 58 | @Override 59 | public boolean isItemValid(ItemStack stack) { 60 | return false; 61 | } 62 | 63 | @Override 64 | public int getItemStackLimit(ItemStack stack) { 65 | return 1; 66 | } 67 | }); 68 | for (int i = 0; i < 3; ++i) { 69 | for (int j = 0; j < 9; ++j) { 70 | this.addSlotToContainer(new Slot(player.inventory, j + i * 9 + 9, 60 + j * 18, 138 + i * 18)); 71 | } 72 | } 73 | 74 | for (int i = 0; i < 9; ++i) { 75 | this.addSlotToContainer(new Slot(player.inventory, i, 60 + i * 18, 196)); 76 | } 77 | if (!player.getEntityWorld().isRemote) { 78 | ItemStack itemStackBook = player.getActiveItemStack(); 79 | if (itemStackBook.hasTagCompound() && itemStackBook.getTagCompound().hasKey("listPid") 80 | &&!itemStackBook.getTagCompound().getString("listPid").equals("")&& itemStackBook.getTagCompound().hasKey("index")) { 81 | //System.out.println(itemStackBook.getTagCompound()); 82 | for(String i:itemStackBook.getTagCompound().getString("listPid").split("%,%")){ 83 | listPid.add(i); 84 | } 85 | if ( listPid.size() >= 1) { 86 | totalPictureNum = listPid.size(); 87 | index = itemStackBook.getTagCompound().getInteger("index"); 88 | if (index + 1 > totalPictureNum) { 89 | index = totalPictureNum-1; 90 | itemStackBook.getTagCompound().setInteger("index", index); 91 | } 92 | String imageName = listPid.get(index); 93 | ItemStack itemPicture = new ItemStack(ItemLoader.itemPicture); 94 | NBTTagCompound nbt = new NBTTagCompound(); 95 | nbt.setString("pid", imageName); 96 | itemPicture.setTagCompound(nbt); 97 | pictureOutSlot.putStack(itemPicture); 98 | } 99 | //System.out.println(totalPictureNum); 100 | } else { 101 | totalPictureNum = 0; 102 | index = -1; 103 | } 104 | lastindex=index; 105 | } 106 | } 107 | 108 | @Override 109 | public void onContainerClosed(EntityPlayer playerIn) { 110 | super.onContainerClosed(playerIn); 111 | if(!playerIn.getEntityWorld().isRemote){ 112 | saveToNBT(playerIn); 113 | } 114 | } 115 | 116 | @Nullable 117 | public ItemStack slotClick(int slotId, int dragType, ClickType clickTypeIn, EntityPlayer player) { 118 | if (!player.getEntityWorld().isRemote) { 119 | if (slotId == 1 && getSlot(1) != null && getSlot(1).getHasStack()) { 120 | listPid.remove(index); 121 | if (index +1>=totalPictureNum) { 122 | index--; 123 | } 124 | totalPictureNum--; 125 | if(totalPictureNum==0){ 126 | index=-1; 127 | } 128 | } 129 | } 130 | ItemStack i = super.slotClick(slotId, dragType, clickTypeIn, player); 131 | saveToNBT(player); 132 | return i; 133 | } 134 | 135 | @Override 136 | public void detectAndSendChanges() { 137 | super.detectAndSendChanges(); 138 | if(lastindex!=index){ 139 | pictureOutSlot.decrStackSize(64); 140 | lastindex=index; 141 | } 142 | if(totalPictureNum!=0&&!pictureOutSlot.getHasStack()&&index!=-1){ 143 | String imageName = listPid.get(index); 144 | ItemStack itemPicture = new ItemStack(ItemLoader.itemPicture); 145 | NBTTagCompound nbt = new NBTTagCompound(); 146 | nbt.setString("pid", imageName); 147 | itemPicture.setTagCompound(nbt); 148 | pictureOutSlot.putStack(itemPicture); 149 | } 150 | // System.out.println(tileEntity.getBurnTime()); 151 | for (IContainerListener i : this.listeners) { 152 | i.sendWindowProperty(this, 0, totalPictureNum); 153 | i.sendWindowProperty(this, 1, index); 154 | } 155 | 156 | } 157 | 158 | @SideOnly(Side.CLIENT) 159 | @Override 160 | public void updateProgressBar(int id, int data) { 161 | super.updateProgressBar(id, data); 162 | switch (id) { 163 | case 0: 164 | this.totalPictureNum = data; 165 | break; 166 | case 1: 167 | this.index = data; 168 | break; 169 | default: 170 | break; 171 | } 172 | } 173 | 174 | @Override 175 | public ItemStack transferStackInSlot(EntityPlayer playerIn, int index) { 176 | ItemStack itemstack = ItemStack.EMPTY; 177 | Slot slot = this.inventorySlots.get(index); 178 | if (slot != null && slot.getHasStack()){ 179 | ItemStack itemstack1 = slot.getStack(); 180 | itemstack = itemstack1.copy(); 181 | if (index >= 0 && index <= 1) { 182 | if (!this.mergeItemStack(itemstack1, 2, 38, true)) { 183 | return ItemStack.EMPTY; 184 | } 185 | 186 | slot.onSlotChange(itemstack1, itemstack); 187 | } else if (index >= 2 && index < 29) { 188 | if (!this.mergeItemStack(itemstack1, 0, 1, false)) { 189 | return ItemStack.EMPTY; 190 | } 191 | } else if (index >= 29 && index < 38) { 192 | if (!this.mergeItemStack(itemstack1, 0, 1, false)) { 193 | return ItemStack.EMPTY; 194 | } 195 | } 196 | if (itemstack1.isEmpty()) { 197 | slot.putStack(ItemStack.EMPTY); 198 | } else { 199 | slot.onSlotChanged(); 200 | } 201 | 202 | if (itemstack1.getCount() == itemstack.getCount()) { 203 | return ItemStack.EMPTY; 204 | } 205 | 206 | slot.onTake(playerIn, itemstack1); 207 | } 208 | return itemstack; 209 | } 210 | 211 | @Override 212 | public boolean canInteractWith(EntityPlayer playerIn) { 213 | return new ItemStack(ItemLoader.itemPictureBook).isItemEqual(playerIn.getActiveItemStack()); 214 | } 215 | 216 | public int getIndex() { 217 | return index; 218 | } 219 | 220 | public int getTotalPictureNum() { 221 | return totalPictureNum; 222 | } 223 | 224 | public List getListPid() { 225 | return listPid; 226 | } 227 | 228 | public void setIndex(int index) { 229 | this.index = index; 230 | } 231 | 232 | public void setTotalPictureNum(int totalPictureNum) { 233 | this.totalPictureNum = totalPictureNum; 234 | } 235 | 236 | public void setListPid(List listPid) { 237 | this.listPid = listPid; 238 | } 239 | 240 | public static int extractDragMode(int eventButton) 241 | { 242 | //System.out.println("button"+eventButton); 243 | return eventButton >> 2 & 3; 244 | } 245 | 246 | private void saveToNBT(EntityPlayer playerIn) { 247 | if (!playerIn.getEntityWorld().isRemote) { 248 | String listPidTotal=""; 249 | for(int i=0;i tooltip, ITooltipFlag advanced) { 30 | String info = (stack.getMaxDamage() - stack.getItemDamage() + 1) + "/" + (stack.getMaxDamage() + 1); 31 | tooltip.add(TextFormatting.GREEN + I18n.format("lore.battery.damage") + TextFormatting.GRAY + info); 32 | tooltip.add(TextFormatting.DARK_GRAY + I18n.format("lore.battery.info")); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/com/porpit/minecamera/item/ItemCamera.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PorPit/MineCamera/d52eb883f2af9a8f66cf183060898c7672c9a471/src/main/java/com/porpit/minecamera/item/ItemCamera.java -------------------------------------------------------------------------------- /src/main/java/com/porpit/minecamera/item/ItemCntsTempLiquid.java: -------------------------------------------------------------------------------- 1 | package com.porpit.minecamera.item; 2 | 3 | import java.util.List; 4 | 5 | import javax.annotation.Nullable; 6 | 7 | import com.porpit.minecamera.creativetab.CreativeTabsLoader; 8 | 9 | import net.minecraft.client.resources.I18n; 10 | import net.minecraft.client.util.ITooltipFlag; 11 | import net.minecraft.entity.player.EntityPlayer; 12 | import net.minecraft.item.Item; 13 | import net.minecraft.item.ItemStack; 14 | import net.minecraft.util.ActionResult; 15 | import net.minecraft.util.EnumActionResult; 16 | import net.minecraft.util.EnumHand; 17 | import net.minecraft.util.text.TextFormatting; 18 | import net.minecraft.world.World; 19 | import net.minecraftforge.fml.relauncher.Side; 20 | import net.minecraftforge.fml.relauncher.SideOnly; 21 | 22 | public class ItemCntsTempLiquid extends Item { 23 | public ItemCntsTempLiquid() { 24 | super(); 25 | this.setUnlocalizedName("cnst_temp_liquid"); 26 | this.setCreativeTab(CreativeTabsLoader.tabMineCamera); 27 | this.setMaxDamage(4); 28 | } 29 | 30 | /* @Override 31 | public ActionResult onItemRightClick(ItemStack itemStackIn, World worldIn, EntityPlayer playerIn, 32 | EnumHand hand) { 33 | // itemStackIn.damageItem(1, playerIn);; 34 | return new ActionResult(EnumActionResult.PASS, itemStackIn); 35 | }*/ 36 | 37 | @Override 38 | @SideOnly(Side.CLIENT) 39 | public void addInformation(ItemStack stack, @Nullable World player, List tooltip, ITooltipFlag advanced){ 40 | String info = (stack.getMaxDamage() - stack.getItemDamage() + 1) + "/" + (stack.getMaxDamage() + 1); 41 | tooltip.add(TextFormatting.GREEN + I18n.format("lore.liquid.damage") + TextFormatting.GRAY + info); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /src/main/java/com/porpit/minecamera/item/ItemDevelopingAgent.java: -------------------------------------------------------------------------------- 1 | package com.porpit.minecamera.item; 2 | 3 | import java.util.List; 4 | 5 | import javax.annotation.Nullable; 6 | 7 | import com.porpit.minecamera.creativetab.CreativeTabsLoader; 8 | 9 | import net.minecraft.client.resources.I18n; 10 | import net.minecraft.client.util.ITooltipFlag; 11 | import net.minecraft.entity.player.EntityPlayer; 12 | import net.minecraft.item.Item; 13 | import net.minecraft.item.ItemStack; 14 | import net.minecraft.util.ActionResult; 15 | import net.minecraft.util.EnumActionResult; 16 | import net.minecraft.util.EnumHand; 17 | import net.minecraft.util.text.TextFormatting; 18 | import net.minecraft.world.World; 19 | import net.minecraftforge.fml.relauncher.Side; 20 | import net.minecraftforge.fml.relauncher.SideOnly; 21 | 22 | public class ItemDevelopingAgent extends Item { 23 | public ItemDevelopingAgent() { 24 | super(); 25 | this.setUnlocalizedName("developing_agent"); 26 | this.setCreativeTab(CreativeTabsLoader.tabMineCamera); 27 | this.setMaxDamage(4); 28 | } 29 | 30 | /* @Override 31 | public ActionResult onItemRightClick(ItemStack itemStackIn, World worldIn, EntityPlayer playerIn, 32 | EnumHand hand) { 33 | // itemStackIn.damageItem(1, playerIn); 34 | return new ActionResult(EnumActionResult.PASS, itemStackIn); 35 | }*/ 36 | 37 | @Override 38 | @SideOnly(Side.CLIENT) 39 | public void addInformation(ItemStack stack, @Nullable World player, List tooltip, ITooltipFlag advanced) { 40 | String info = (stack.getMaxDamage() - stack.getItemDamage() + 1) + "/" + (stack.getMaxDamage() + 1); 41 | tooltip.add(TextFormatting.GREEN + I18n.format("lore.liquid.damage") + TextFormatting.GRAY + info); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /src/main/java/com/porpit/minecamera/item/ItemFilm.java: -------------------------------------------------------------------------------- 1 | package com.porpit.minecamera.item; 2 | 3 | import java.text.SimpleDateFormat; 4 | import java.util.List; 5 | 6 | import javax.annotation.Nullable; 7 | 8 | import com.porpit.minecamera.creativetab.CreativeTabsLoader; 9 | 10 | import net.minecraft.client.resources.I18n; 11 | import net.minecraft.client.util.ITooltipFlag; 12 | import net.minecraft.entity.player.EntityPlayer; 13 | import net.minecraft.entity.player.EntityPlayerMP; 14 | import net.minecraft.item.Item; 15 | import net.minecraft.item.ItemStack; 16 | import net.minecraft.util.ActionResult; 17 | import net.minecraft.util.EnumActionResult; 18 | import net.minecraft.util.EnumHand; 19 | import net.minecraft.util.text.TextFormatting; 20 | import net.minecraft.world.World; 21 | import net.minecraftforge.fml.relauncher.Side; 22 | import net.minecraftforge.fml.relauncher.SideOnly; 23 | 24 | public class ItemFilm extends Item { 25 | public ItemFilm() { 26 | super(); 27 | this.setUnlocalizedName("film"); 28 | this.setCreativeTab(CreativeTabsLoader.tabMineCamera); 29 | } 30 | 31 | /* 32 | * @Override 33 | * 34 | * @SideOnly(Side.CLIENT) public void getSubItems(Item itemIn, CreativeTabs 35 | * tab, List subItems) { ItemStack film=new ItemStack(itemIn,1); 36 | * NBTTagCompound filmdata=new NBTTagCompound(); filmdata.setString("pid", 37 | * "none"); filmdata.setString("user", "none"); 38 | * film.setTagCompound(filmdata); subItems.add(film); } 39 | */ 40 | /* @Override 41 | public ActionResult onItemRightClick(ItemStack itemStackIn, World worldIn, EntityPlayer playerIn, 42 | EnumHand hand) { 43 | // itemStackIn.getTagCompound().setString("pid", 44 | // "Player735_1510202549059"); 45 | 46 | * NBTTagCompound filmdata=new NBTTagCompound(); 47 | * filmdata.setString("id", "none"); NBTTagCompound nc=new 48 | * NBTTagCompound(); itemStackIn.writeToNBT(nc); nc.setTag("tag", 49 | * filmdata); itemStackIn.readFromNBT(nc); 50 | 51 | System.out.println("0:" + hand); 52 | System.out.println("1:" + playerIn.getActiveHand()); 53 | playerIn.setActiveHand(hand); 54 | if (playerIn instanceof EntityPlayerMP) { 55 | ((EntityPlayerMP) playerIn).setActiveHand(hand); 56 | } 57 | System.out.println("2:" + playerIn.getActiveHand()); 58 | System.out.println(itemStackIn.hasTagCompound()); 59 | // String id =itemStackIn.getTagCompound().getString("pid"); 60 | // String user =itemStackIn.getTagCompound().getString("user"); 61 | // System.out.println("pid="+id); 62 | // System.out.println("user="+user); 63 | // itemStackIn.getTagCompound().setString("pid", "123456"); 64 | // itemStackIn.getTagCompound().setString("user", "PorPit"); 65 | return new ActionResult(EnumActionResult.PASS, itemStackIn); 66 | }*/ 67 | 68 | @Override 69 | @SideOnly(Side.CLIENT) 70 | public void addInformation(ItemStack stack, @Nullable World player, List tooltip, ITooltipFlag advanced) { 71 | String used = (I18n.format("lore.film.info.used")); 72 | String unused = (I18n.format("lore.film.info.unused")); 73 | 74 | // System.out.println(stack.hasTagCompound()); 75 | if (stack.hasTagCompound() && stack.getTagCompound().hasKey("pid")) { 76 | String pid = stack.getTagCompound().getString("pid"); 77 | tooltip.add(TextFormatting.BLUE + I18n.format("lore.film.info") + TextFormatting.RED + used); 78 | if (pid.contains("%_%")) { 79 | String[] data = pid.split("%_%"); 80 | String author = data[0]; 81 | Long time = Long.valueOf(data[1]); 82 | tooltip.add(TextFormatting.BLUE + I18n.format("lore.film.author") + TextFormatting.GREEN + author); 83 | SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); 84 | String d = format.format(time); 85 | tooltip.add(TextFormatting.BLUE + I18n.format("lore.film.time") + TextFormatting.GREEN + d); 86 | } 87 | } else { 88 | tooltip.add(TextFormatting.BLUE + I18n.format("lore.film.info") + TextFormatting.GREEN + unused); 89 | } 90 | } 91 | } 92 | -------------------------------------------------------------------------------- /src/main/java/com/porpit/minecamera/item/ItemGlassesHelmet.java: -------------------------------------------------------------------------------- 1 | package com.porpit.minecamera.item; 2 | 3 | import java.util.List; 4 | 5 | import javax.annotation.Nullable; 6 | 7 | import com.porpit.minecamera.MineCamera; 8 | import com.porpit.minecamera.creativetab.CreativeTabsLoader; 9 | 10 | import net.minecraft.client.resources.I18n; 11 | import net.minecraft.client.util.ITooltipFlag; 12 | import net.minecraft.entity.player.EntityPlayer; 13 | import net.minecraft.inventory.EntityEquipmentSlot; 14 | import net.minecraft.item.ItemArmor; 15 | import net.minecraft.item.ItemStack; 16 | import net.minecraft.util.ResourceLocation; 17 | import net.minecraft.util.SoundEvent; 18 | import net.minecraft.util.text.TextFormatting; 19 | import net.minecraft.world.World; 20 | import net.minecraftforge.common.util.EnumHelper; 21 | import net.minecraftforge.fml.relauncher.Side; 22 | import net.minecraftforge.fml.relauncher.SideOnly; 23 | 24 | public class ItemGlassesHelmet extends ItemArmor 25 | { 26 | public static final ItemArmor.ArmorMaterial GALSSES_ARMOR = EnumHelper.addArmorMaterial("GLASSES", 27 | MineCamera.MODID + ":" + "glasses", 10, new int[] 28 | { 2, 6, 4, 2 }, 10,SoundEvent.REGISTRY.getObject(new ResourceLocation("item.armor.equip_iron")),10); 29 | 30 | public ItemGlassesHelmet() 31 | { 32 | super(GALSSES_ARMOR, GALSSES_ARMOR.ordinal(), EntityEquipmentSlot.HEAD); 33 | this.setUnlocalizedName("glasses_helmet"); 34 | this.setCreativeTab(CreativeTabsLoader.tabMineCamera); 35 | this.setMaxDamage(500); 36 | } 37 | 38 | @Override 39 | @SideOnly(Side.CLIENT) 40 | public void addInformation(ItemStack stack, @Nullable World player, List tooltip, ITooltipFlag advanced) { 41 | tooltip.add(TextFormatting.BLUE + I18n.format("lore.glasses_helmet.info")); 42 | tooltip.add(TextFormatting.DARK_GRAY + I18n.format("lore.glasses_helmet.info2")); 43 | } 44 | } -------------------------------------------------------------------------------- /src/main/java/com/porpit/minecamera/item/ItemLoader.java: -------------------------------------------------------------------------------- 1 | package com.porpit.minecamera.item; 2 | 3 | import net.minecraft.client.renderer.block.model.ModelResourceLocation; 4 | import net.minecraft.item.Item; 5 | import net.minecraft.item.ItemArmor; 6 | import net.minecraftforge.client.model.ModelLoader; 7 | import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; 8 | import net.minecraftforge.fml.common.registry.ForgeRegistries; 9 | import net.minecraftforge.fml.common.registry.GameRegistry; 10 | import net.minecraftforge.fml.relauncher.Side; 11 | import net.minecraftforge.fml.relauncher.SideOnly; 12 | 13 | public class ItemLoader { 14 | public static Item itemCamera = new ItemCamera(); 15 | public static Item itemPicture = new ItemPicture(); 16 | public static Item itemBattery = new ItemBattery(); 17 | public static Item itemFilm = new ItemFilm(); 18 | public static Item itemCntsTempLiquid = new ItemCntsTempLiquid(); 19 | public static Item itemDevelopingAgent = new ItemDevelopingAgent(); 20 | public static Item itemTripod = new ItemTripod(); 21 | public static Item itemPhotoPaper= new ItemPhotoPaper(); 22 | public static Item itemPictureBook =new ItemPictureBook(); 23 | public static ItemArmor itemGlassesHelmet = new ItemGlassesHelmet(); 24 | 25 | public ItemLoader(FMLPreInitializationEvent event) { 26 | register(itemCamera, "camera"); 27 | register(itemTripod, "tripod"); 28 | register(itemBattery, "battery"); 29 | register(itemFilm, "film"); 30 | register(itemPhotoPaper, "photo_paper"); 31 | register(itemPictureBook, "picture_book"); 32 | register(itemCntsTempLiquid, "cnts_temp_liquid"); 33 | register(itemDevelopingAgent, "developing_agent"); 34 | register(itemPicture, "picture"); 35 | register(itemGlassesHelmet, "glasses_helmet"); 36 | } 37 | 38 | @SideOnly(Side.CLIENT) 39 | public static void registerRenders() { 40 | registerRender(itemCamera); 41 | registerRender(itemTripod); 42 | registerRender(itemBattery); 43 | registerRender(itemFilm); 44 | registerRender(itemCntsTempLiquid); 45 | registerRender(itemDevelopingAgent); 46 | registerRender(itemPhotoPaper); 47 | registerRender(itemPictureBook); 48 | registerRender(itemPicture); 49 | registerRender(itemGlassesHelmet); 50 | } 51 | 52 | private static void register(Item item, String name) { 53 | ForgeRegistries.ITEMS.register(item.setRegistryName(name)); 54 | } 55 | 56 | @SideOnly(Side.CLIENT) 57 | private static void registerRender(Item item, int meta, String name) { 58 | ModelResourceLocation model = new ModelResourceLocation(name, "inventory"); 59 | ModelLoader.setCustomModelResourceLocation(item, meta, model); 60 | } 61 | 62 | @SideOnly(Side.CLIENT) 63 | private static void registerRender(Item item) { 64 | System.out.println(item.getRegistryName().toString()); 65 | registerRender(item, 0, item.getRegistryName().toString()); 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /src/main/java/com/porpit/minecamera/item/ItemPhotoPaper.java: -------------------------------------------------------------------------------- 1 | package com.porpit.minecamera.item; 2 | 3 | import com.porpit.minecamera.creativetab.CreativeTabsLoader; 4 | 5 | import net.minecraft.item.Item; 6 | 7 | public class ItemPhotoPaper extends Item{ 8 | public ItemPhotoPaper(){ 9 | super(); 10 | this.setMaxStackSize(64); 11 | this.setUnlocalizedName("photo_paper"); 12 | this.setCreativeTab(CreativeTabsLoader.tabMineCamera); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/main/java/com/porpit/minecamera/item/ItemPicture.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PorPit/MineCamera/d52eb883f2af9a8f66cf183060898c7672c9a471/src/main/java/com/porpit/minecamera/item/ItemPicture.java -------------------------------------------------------------------------------- /src/main/java/com/porpit/minecamera/item/ItemPictureBook.java: -------------------------------------------------------------------------------- 1 | package com.porpit.minecamera.item; 2 | 3 | import java.util.List; 4 | 5 | import javax.annotation.Nullable; 6 | 7 | import com.porpit.minecamera.MineCamera; 8 | import com.porpit.minecamera.creativetab.CreativeTabsLoader; 9 | import com.porpit.minecamera.inventory.GuiElementLoader; 10 | 11 | import net.minecraft.client.resources.I18n; 12 | import net.minecraft.client.util.ITooltipFlag; 13 | import net.minecraft.entity.player.EntityPlayer; 14 | import net.minecraft.entity.player.EntityPlayerMP; 15 | import net.minecraft.item.EnumAction; 16 | import net.minecraft.item.Item; 17 | import net.minecraft.item.ItemStack; 18 | import net.minecraft.nbt.NBTTagCompound; 19 | import net.minecraft.util.ActionResult; 20 | import net.minecraft.util.EnumActionResult; 21 | import net.minecraft.util.EnumFacing; 22 | import net.minecraft.util.EnumHand; 23 | import net.minecraft.util.math.BlockPos; 24 | import net.minecraft.util.text.TextFormatting; 25 | import net.minecraft.world.World; 26 | import net.minecraftforge.fml.relauncher.Side; 27 | import net.minecraftforge.fml.relauncher.SideOnly; 28 | 29 | public class ItemPictureBook extends Item { 30 | public ItemPictureBook() { 31 | super(); 32 | this.setUnlocalizedName("picture_book"); 33 | this.setCreativeTab(CreativeTabsLoader.tabMineCamera); 34 | this.setMaxStackSize(1); 35 | } 36 | 37 | @Override 38 | public ActionResult onItemRightClick(World worldIn, EntityPlayer playerIn, EnumHand handIn) { 39 | playerIn.setActiveHand(handIn); 40 | if (!worldIn.isRemote) { 41 | BlockPos pos = playerIn.getPosition(); 42 | int id = GuiElementLoader.GUI_PICTURE_BOOK; 43 | playerIn.openGui(MineCamera.instance, id, worldIn, pos.getX(), pos.getY(), pos.getZ()); 44 | } 45 | return new ActionResult(EnumActionResult.SUCCESS, playerIn.getHeldItem(handIn)); 46 | } 47 | 48 | @Override 49 | public int getMaxItemUseDuration(ItemStack stack) { 50 | return 72000; 51 | } 52 | 53 | /* @Override 54 | public EnumActionResult onItemUse(ItemStack stack, EntityPlayer playerIn, World worldIn, BlockPos pos, 55 | EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ) { 56 | return super.onItemUse(stack, playerIn, worldIn, pos, hand, facing, hitX, hitY, hitZ); 57 | }*/ 58 | 59 | @Override 60 | @SideOnly(Side.CLIENT) 61 | public void addInformation(ItemStack stack, @Nullable World player, List tooltip, ITooltipFlag advanced) { 62 | int num=0; 63 | if(stack.hasTagCompound()) 64 | { 65 | if(stack.getTagCompound().hasKey("num")){ 66 | num=stack.getTagCompound().getInteger("num"); 67 | }else if(stack.getTagCompound().hasKey("listPid")&&!stack.getTagCompound().getString("listPid").equals("")){ 68 | num=stack.getTagCompound().getString("listPid").split("%,%").length; 69 | stack.getTagCompound().setInteger("num", num); 70 | } 71 | } 72 | tooltip.add(TextFormatting.GREEN + I18n.format("lore.picturebook.info") + TextFormatting.GRAY + ""+num); 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /src/main/java/com/porpit/minecamera/item/ItemTripod.java: -------------------------------------------------------------------------------- 1 | package com.porpit.minecamera.item; 2 | 3 | import java.util.List; 4 | 5 | import javax.annotation.Nullable; 6 | 7 | import com.porpit.minecamera.creativetab.CreativeTabsLoader; 8 | import com.porpit.minecamera.entity.EntityTripod; 9 | 10 | import net.minecraft.client.resources.I18n; 11 | import net.minecraft.client.util.ITooltipFlag; 12 | import net.minecraft.entity.Entity; 13 | import net.minecraft.entity.player.EntityPlayer; 14 | import net.minecraft.item.Item; 15 | import net.minecraft.item.ItemStack; 16 | import net.minecraft.util.EnumActionResult; 17 | import net.minecraft.util.EnumFacing; 18 | import net.minecraft.util.EnumHand; 19 | import net.minecraft.util.math.BlockPos; 20 | import net.minecraft.util.text.TextComponentTranslation; 21 | import net.minecraft.util.text.TextFormatting; 22 | import net.minecraft.world.World; 23 | import net.minecraftforge.fml.relauncher.Side; 24 | import net.minecraftforge.fml.relauncher.SideOnly; 25 | 26 | public class ItemTripod extends Item { 27 | public ItemTripod() { 28 | super(); 29 | this.setUnlocalizedName("tripod"); 30 | this.setCreativeTab(CreativeTabsLoader.tabMineCamera); 31 | } 32 | 33 | @Override 34 | public EnumActionResult onItemUse(EntityPlayer player, World worldIn, BlockPos pos, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ) { 35 | ItemStack stack=player.getHeldItem(hand); 36 | if (!worldIn.isRemote) { 37 | if(!facing.equals(EnumFacing.UP)){ 38 | player.sendMessage(new TextComponentTranslation("chat.tripod.mustup")); 39 | return EnumActionResult.PASS; 40 | } 41 | Entity entity = new EntityTripod(worldIn); 42 | entity.setPositionAndUpdate(pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5); 43 | entity.rotationYaw = player.rotationYaw; 44 | entity.rotationPitch = player.rotationPitch; 45 | worldIn.spawnEntity(entity); 46 | System.out.println("spawn"); 47 | // worldIn.updateEntities(); 48 | stack.shrink(1); 49 | return EnumActionResult.SUCCESS; 50 | } 51 | return EnumActionResult.PASS; 52 | } 53 | 54 | @Override 55 | @SideOnly(Side.CLIENT) 56 | public void addInformation(ItemStack stack, @Nullable World player, List tooltip, ITooltipFlag advanced) { 57 | tooltip.add(TextFormatting.BLUE + I18n.format("lore.tripod.info")); 58 | tooltip.add(TextFormatting.BLUE + I18n.format("lore.tripod.info2")); 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /src/main/java/com/porpit/minecamera/network/MessageCameraDelaySet.java: -------------------------------------------------------------------------------- 1 | package com.porpit.minecamera.network; 2 | 3 | import com.porpit.minecamera.entity.EntityTripod; 4 | 5 | import io.netty.buffer.ByteBuf; 6 | import net.minecraft.entity.Entity; 7 | import net.minecraft.entity.player.EntityPlayerMP; 8 | import net.minecraftforge.common.DimensionManager; 9 | import net.minecraftforge.fml.common.network.simpleimpl.IMessage; 10 | import net.minecraftforge.fml.common.network.simpleimpl.IMessageHandler; 11 | import net.minecraftforge.fml.common.network.simpleimpl.MessageContext; 12 | import net.minecraftforge.fml.relauncher.Side; 13 | 14 | public class MessageCameraDelaySet implements IMessage { 15 | public int delay; 16 | 17 | @Override 18 | public void fromBytes(ByteBuf buf) { 19 | this.delay = buf.readInt(); 20 | } 21 | 22 | @Override 23 | public void toBytes(ByteBuf buf) { 24 | buf.writeInt(delay); 25 | } 26 | 27 | public static class Handler implements IMessageHandler { 28 | @Override 29 | public IMessage onMessage(MessageCameraDelaySet message, MessageContext ctx) { 30 | if (ctx.side == Side.SERVER) { 31 | EntityPlayerMP player = ctx.getServerHandler().player; 32 | Entity entity = player.getEntityWorld() 33 | .getEntityByID(player.getEntityData().getInteger("usingGui")); 34 | if(player==null||entity==null||!(entity instanceof EntityTripod)){return null;} 35 | ((EntityTripod) entity).setDelay(message.delay); 36 | } 37 | return null; 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/main/java/com/porpit/minecamera/network/MessageFailLoadImage.java: -------------------------------------------------------------------------------- 1 | package com.porpit.minecamera.network; 2 | 3 | import com.porpit.minecamera.util.EnumFailLoadImage; 4 | import com.porpit.minecamera.util.PictureFactory; 5 | 6 | import io.netty.buffer.ByteBuf; 7 | import net.minecraftforge.fml.common.network.simpleimpl.IMessage; 8 | import net.minecraftforge.fml.common.network.simpleimpl.IMessageHandler; 9 | import net.minecraftforge.fml.common.network.simpleimpl.MessageContext; 10 | import net.minecraftforge.fml.relauncher.Side; 11 | 12 | public class MessageFailLoadImage implements IMessage { 13 | public EnumFailLoadImage type; 14 | public String imagename; 15 | @Override 16 | public void fromBytes(ByteBuf buf) { 17 | type=EnumFailLoadImage.values()[buf.readInt()]; 18 | int imagenamelength = buf.readInt(); 19 | byte imagenamebyte[] = new byte[imagenamelength]; 20 | buf.readBytes(imagenamebyte); 21 | imagename = new String(imagenamebyte); 22 | } 23 | 24 | @Override 25 | public void toBytes(ByteBuf buf) { 26 | buf.writeInt(type.ordinal()); 27 | buf.writeInt(imagename.length()); 28 | buf.writeBytes(imagename.getBytes()); 29 | } 30 | 31 | public static class Handler implements IMessageHandler { 32 | @Override 33 | public IMessage onMessage(MessageFailLoadImage message, MessageContext ctx) { 34 | if (ctx.side == Side.CLIENT) { 35 | PictureFactory.fildToLoadPicture.put(message.imagename, message.type); 36 | if(PictureFactory.lodingPicture.contains(message.imagename)) 37 | { 38 | PictureFactory.lodingPicture.remove(message.imagename); 39 | } 40 | } 41 | return null; 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/main/java/com/porpit/minecamera/network/MessageImage.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PorPit/MineCamera/d52eb883f2af9a8f66cf183060898c7672c9a471/src/main/java/com/porpit/minecamera/network/MessageImage.java -------------------------------------------------------------------------------- /src/main/java/com/porpit/minecamera/network/MessageImageRequest.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PorPit/MineCamera/d52eb883f2af9a8f66cf183060898c7672c9a471/src/main/java/com/porpit/minecamera/network/MessageImageRequest.java -------------------------------------------------------------------------------- /src/main/java/com/porpit/minecamera/network/MessageImageSyncSave.java: -------------------------------------------------------------------------------- 1 | package com.porpit.minecamera.network; 2 | 3 | import com.porpit.minecamera.util.SaveImageThread; 4 | 5 | import io.netty.buffer.ByteBuf; 6 | import net.minecraftforge.fml.common.network.simpleimpl.IMessage; 7 | import net.minecraftforge.fml.common.network.simpleimpl.IMessageHandler; 8 | import net.minecraftforge.fml.common.network.simpleimpl.MessageContext; 9 | import net.minecraftforge.fml.relauncher.Side; 10 | 11 | public class MessageImageSyncSave implements IMessage { 12 | public String imageName; 13 | 14 | @Override 15 | public void fromBytes(ByteBuf buf) { 16 | int namelength = buf.readInt(); 17 | byte namebyte[] = new byte[namelength]; 18 | buf.readBytes(namebyte); 19 | imageName = new String(namebyte); 20 | } 21 | 22 | @Override 23 | public void toBytes(ByteBuf buf) { 24 | buf.writeInt(imageName.getBytes().length); 25 | buf.writeBytes(imageName.getBytes()); 26 | } 27 | 28 | public static class Handler implements IMessageHandler { 29 | @Override 30 | public IMessage onMessage(MessageImageSyncSave message, MessageContext ctx) { 31 | if (ctx.side == Side.CLIENT) { 32 | SaveImageThread thread = new SaveImageThread(message.imageName); 33 | thread.start(); 34 | } 35 | return null; 36 | } 37 | 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/main/java/com/porpit/minecamera/network/MessagePhotoProcessorStart.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PorPit/MineCamera/d52eb883f2af9a8f66cf183060898c7672c9a471/src/main/java/com/porpit/minecamera/network/MessagePhotoProcessorStart.java -------------------------------------------------------------------------------- /src/main/java/com/porpit/minecamera/network/MessagePictureBookIndex.java: -------------------------------------------------------------------------------- 1 | package com.porpit.minecamera.network; 2 | 3 | import com.porpit.minecamera.inventory.ContainerPictureBook; 4 | 5 | import io.netty.buffer.ByteBuf; 6 | import net.minecraft.entity.player.EntityPlayerMP; 7 | import net.minecraftforge.common.DimensionManager; 8 | import net.minecraftforge.fml.common.network.simpleimpl.IMessage; 9 | import net.minecraftforge.fml.common.network.simpleimpl.IMessageHandler; 10 | import net.minecraftforge.fml.common.network.simpleimpl.MessageContext; 11 | import net.minecraftforge.fml.relauncher.Side; 12 | 13 | public class MessagePictureBookIndex implements IMessage { 14 | public int index; 15 | 16 | @Override 17 | public void fromBytes(ByteBuf buf) { 18 | index = buf.readInt(); 19 | } 20 | 21 | @Override 22 | public void toBytes(ByteBuf buf) { 23 | buf.writeInt(index); 24 | } 25 | 26 | public static class Handler implements IMessageHandler { 27 | @Override 28 | public IMessage onMessage(MessagePictureBookIndex message, MessageContext ctx) { 29 | if (ctx.side == Side.SERVER) { 30 | EntityPlayerMP player = ctx.getServerHandler().player; 31 | if (player != null && player.openContainer != null 32 | && player.openContainer instanceof ContainerPictureBook) { 33 | ContainerPictureBook contaner = (ContainerPictureBook) player.openContainer; 34 | if (message.index >= 0 && message.index < contaner.getTotalPictureNum()) { 35 | contaner.setIndex(message.index); 36 | } 37 | } 38 | } 39 | return null; 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/main/java/com/porpit/minecamera/network/MessagePictureBookInput.java: -------------------------------------------------------------------------------- 1 | package com.porpit.minecamera.network; 2 | 3 | import com.porpit.minecamera.inventory.ContainerPictureBook; 4 | 5 | import io.netty.buffer.ByteBuf; 6 | import net.minecraft.entity.player.EntityPlayerMP; 7 | import net.minecraft.item.ItemStack; 8 | import net.minecraft.util.text.TextComponentTranslation; 9 | import net.minecraftforge.fml.common.network.simpleimpl.IMessage; 10 | import net.minecraftforge.fml.common.network.simpleimpl.IMessageHandler; 11 | import net.minecraftforge.fml.common.network.simpleimpl.MessageContext; 12 | import net.minecraftforge.fml.relauncher.Side; 13 | 14 | public class MessagePictureBookInput implements IMessage { 15 | 16 | @Override 17 | public void fromBytes(ByteBuf buf) { 18 | } 19 | 20 | @Override 21 | public void toBytes(ByteBuf buf) { 22 | 23 | } 24 | 25 | public static class Handler implements IMessageHandler { 26 | @Override 27 | public IMessage onMessage(MessagePictureBookInput message, MessageContext ctx) { 28 | if (ctx.side == Side.SERVER) { 29 | EntityPlayerMP player = ctx.getServerHandler().player; 30 | if (player != null && player.openContainer != null 31 | && player.openContainer instanceof ContainerPictureBook) { 32 | ContainerPictureBook contaner = (ContainerPictureBook) player.openContainer; 33 | if (contaner.getSlot(0).getHasStack() && contaner.getSlot(0).getStack().hasTagCompound() 34 | && contaner.getSlot(0).getStack().getTagCompound().hasKey("pid")) { 35 | ItemStack itemStack = contaner.getSlot(0).getStack(); 36 | String pid = itemStack.getTagCompound().getString("pid"); 37 | if (contaner.getTotalPictureNum() <= 100) { 38 | contaner.getListPid().add(pid); 39 | contaner.setTotalPictureNum(contaner.getTotalPictureNum() + 1); 40 | if (contaner.getTotalPictureNum() == 1) { 41 | contaner.setIndex(0); 42 | } 43 | } else { 44 | player.sendMessage(new TextComponentTranslation("chat.picturebook.tomany")); 45 | return null; 46 | } 47 | } 48 | contaner.getSlot(0).decrStackSize(64); 49 | } 50 | } 51 | return null; 52 | } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /src/main/java/com/porpit/minecamera/network/MessagePlayerViewRender.java: -------------------------------------------------------------------------------- 1 | package com.porpit.minecamera.network; 2 | 3 | import io.netty.buffer.ByteBuf; 4 | import net.minecraftforge.common.DimensionManager; 5 | import net.minecraftforge.fml.common.network.simpleimpl.IMessage; 6 | import net.minecraftforge.fml.common.network.simpleimpl.IMessageHandler; 7 | import net.minecraftforge.fml.common.network.simpleimpl.MessageContext; 8 | import net.minecraftforge.fml.relauncher.Side; 9 | 10 | public class MessagePlayerViewRender implements IMessage { 11 | 12 | @Override 13 | public void fromBytes(ByteBuf buf) { 14 | } 15 | 16 | @Override 17 | public void toBytes(ByteBuf buf) { 18 | } 19 | 20 | public static class Handler implements IMessageHandler { 21 | @Override 22 | public IMessage onMessage(MessagePlayerViewRender message, MessageContext ctx) { 23 | if (ctx.side == Side.SERVER) { 24 | if(ctx.getServerHandler().player!=null){ 25 | ctx.getServerHandler().player.getEntityData().removeTag("renderViewCamera"); 26 | } 27 | } 28 | return null; 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/com/porpit/minecamera/network/MessageSpawnParticle.java: -------------------------------------------------------------------------------- 1 | package com.porpit.minecamera.network; 2 | 3 | import io.netty.buffer.ByteBuf; 4 | import net.minecraft.client.Minecraft; 5 | import net.minecraft.util.EnumParticleTypes; 6 | import net.minecraftforge.fml.common.network.simpleimpl.IMessage; 7 | import net.minecraftforge.fml.common.network.simpleimpl.IMessageHandler; 8 | import net.minecraftforge.fml.common.network.simpleimpl.MessageContext; 9 | import net.minecraftforge.fml.relauncher.Side; 10 | 11 | public class MessageSpawnParticle implements IMessage { 12 | public int delay; 13 | public int typeid; 14 | public double PosX; 15 | public double PosY; 16 | public double PosZ; 17 | public double SpeedX; 18 | public double SpeedY; 19 | public double SpeedZ; 20 | 21 | @Override 22 | public void fromBytes(ByteBuf buf) { 23 | this.delay = buf.readInt(); 24 | this.typeid = buf.readInt(); 25 | this.PosX = buf.readDouble(); 26 | this.PosY = buf.readDouble(); 27 | this.PosZ = buf.readDouble(); 28 | this.SpeedX = buf.readDouble(); 29 | this.SpeedY = buf.readDouble(); 30 | this.SpeedZ = buf.readDouble(); 31 | } 32 | 33 | @Override 34 | public void toBytes(ByteBuf buf) { 35 | buf.writeInt(delay); 36 | buf.writeInt(typeid); 37 | buf.writeDouble(PosX); 38 | buf.writeDouble(PosY); 39 | buf.writeDouble(PosZ); 40 | buf.writeDouble(SpeedX); 41 | buf.writeDouble(SpeedY); 42 | buf.writeDouble(SpeedZ); 43 | } 44 | 45 | public static class Handler implements IMessageHandler { 46 | @Override 47 | public IMessage onMessage(MessageSpawnParticle message, MessageContext ctx) { 48 | System.out.println(ctx.side.toString()); 49 | if (ctx.side == Side.CLIENT) { 50 | SpawnParticleAsyncThread thread = new SpawnParticleAsyncThread(message.delay, message.typeid, 51 | message.PosX, message.PosY, message.PosZ, message.SpeedX, message.SpeedY, message.SpeedZ); 52 | thread.start(); 53 | } 54 | return null; 55 | } 56 | } 57 | 58 | private static class SpawnParticleAsyncThread extends Thread { 59 | private int delay; 60 | private int typeid; 61 | private double PosX; 62 | private double PosY; 63 | private double PosZ; 64 | private double SpeedX; 65 | private double SpeedY; 66 | private double SpeedZ; 67 | 68 | public SpawnParticleAsyncThread(int delay, int typeid, double posX, double posY, double posZ, double speedX, 69 | double speedY, double speedZ) { 70 | this.delay = delay; 71 | this.typeid = typeid; 72 | this.PosX = posX; 73 | this.PosY = posY; 74 | this.PosZ = posZ; 75 | this.SpeedX = speedX; 76 | this.SpeedY = speedY; 77 | this.SpeedZ = speedZ; 78 | } 79 | 80 | public void run() { 81 | if (delay > 0) { 82 | try { 83 | currentThread().sleep(delay); 84 | } catch (InterruptedException e) { 85 | e.printStackTrace(); 86 | } 87 | } 88 | Minecraft.getMinecraft().world.spawnParticle(EnumParticleTypes.getParticleFromId(typeid), this.PosX, 89 | this.PosY, this.PosZ, this.SpeedX, this.SpeedY, this.SpeedZ, 0); 90 | } 91 | } 92 | } 93 | -------------------------------------------------------------------------------- /src/main/java/com/porpit/minecamera/network/MessageTripodFilmOut.java: -------------------------------------------------------------------------------- 1 | package com.porpit.minecamera.network; 2 | 3 | import java.util.List; 4 | 5 | import com.porpit.minecamera.entity.EntityTripod; 6 | import com.porpit.minecamera.item.ItemLoader; 7 | 8 | import io.netty.buffer.ByteBuf; 9 | import net.minecraft.entity.Entity; 10 | import net.minecraft.entity.player.EntityPlayer; 11 | import net.minecraft.entity.player.EntityPlayerMP; 12 | import net.minecraft.item.ItemStack; 13 | import net.minecraft.nbt.NBTTagCompound; 14 | import net.minecraft.network.play.server.SPacketCustomSound; 15 | import net.minecraft.util.EnumParticleTypes; 16 | import net.minecraft.util.SoundCategory; 17 | import net.minecraft.util.math.AxisAlignedBB; 18 | import net.minecraft.util.text.TextComponentTranslation; 19 | import net.minecraftforge.fml.common.network.simpleimpl.IMessage; 20 | import net.minecraftforge.fml.common.network.simpleimpl.IMessageHandler; 21 | import net.minecraftforge.fml.common.network.simpleimpl.MessageContext; 22 | import net.minecraftforge.fml.relauncher.Side; 23 | import net.minecraftforge.items.CapabilityItemHandler; 24 | import net.minecraftforge.items.IItemHandler; 25 | 26 | public class MessageTripodFilmOut implements IMessage { 27 | 28 | @Override 29 | public void fromBytes(ByteBuf buf) { 30 | } 31 | 32 | @Override 33 | public void toBytes(ByteBuf buf) { 34 | } 35 | 36 | public static class Handler implements IMessageHandler { 37 | @Override 38 | public IMessage onMessage(MessageTripodFilmOut message, MessageContext ctx) { 39 | if (ctx.side == Side.SERVER) { 40 | EntityPlayerMP player = ctx.getServerHandler().player; 41 | Entity entity = player.getEntityWorld() 42 | .getEntityByID(player.getEntityData().getInteger("renderViewCamera")); 43 | if (player != null && entity != null && entity instanceof EntityTripod) { 44 | IItemHandler items = entity.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, 45 | player.getHorizontalFacing()); 46 | if (items.getStackInSlot(3) != null && !items.getStackInSlot(3).isEmpty()) { 47 | player.sendMessage(new TextComponentTranslation("chat.minecamera.isouting")); 48 | return null; 49 | } 50 | if (items.getStackInSlot(0) == null || items.getStackInSlot(0).isEmpty()) { 51 | player.sendMessage(new TextComponentTranslation("chat.minecamera.nobettery")); 52 | return null; 53 | } 54 | if (items.getStackInSlot(1) == null || items.getStackInSlot(1).isEmpty()) { 55 | player.sendMessage(new TextComponentTranslation("chat.minecamera.nofilm")); 56 | return null; 57 | } 58 | if (items.getStackInSlot(2) != null && !items.getStackInSlot(2).isEmpty()) { 59 | player.sendMessage(new TextComponentTranslation("chat.minecamera.hasfilmout")); 60 | return null; 61 | } 62 | if (items.getStackInSlot(1).hasTagCompound() 63 | && items.getStackInSlot(1).getTagCompound().hasKey("pid")) { 64 | player.sendMessage((new TextComponentTranslation("chat.minecamera.filmcantwrite"))); 65 | return null; 66 | } 67 | items.getStackInSlot(0).damageItem(1, player); 68 | if (items.getStackInSlot(0).getCount() == 0) { 69 | items.extractItem(0, 1, false); 70 | } 71 | items.extractItem(1, 64, false); 72 | String imagename = ctx.getServerHandler().player.getName() + "%_%" 73 | + System.currentTimeMillis(); 74 | ItemStack itemfilm = new ItemStack(ItemLoader.itemFilm, 1); 75 | NBTTagCompound nbt = new NBTTagCompound(); 76 | nbt.setString("pid", imagename); 77 | itemfilm.setTagCompound(nbt); 78 | /* 79 | * if(!(items.getStackInSlot(3)==null)){ 80 | * items.getStackInSlot(3).stackSize=0; } 81 | */ 82 | items.insertItem(3, itemfilm, false); 83 | ((EntityTripod) entity).setBurnTime(0); 84 | player.sendMessage((new TextComponentTranslation("chat.minecamera.success"))); 85 | // effect 86 | 87 | 88 | ctx.getServerHandler().player.getServer().addScheduledTask(new Runnable() { 89 | @Override 90 | public void run() { 91 | double particlePosX = entity.posX, particlePosY = entity.posY + 1.35, particlePosZ = entity.posZ; 92 | particlePosX = particlePosX + (-Math.sin(Math.toRadians(entity.rotationYaw + 15)) * 0.7); 93 | particlePosZ = particlePosZ + (Math.cos(Math.toRadians(entity.rotationYaw + 15)) * 0.7); 94 | List listentity = entity.getEntityWorld().getEntitiesWithinAABB(EntityPlayer.class, 95 | new AxisAlignedBB(entity.posX - 16, entity.posY - 16, entity.posZ - 16, entity.posX + 16, 96 | entity.posY + 16, entity.posZ + 16)); 97 | // System.out.println("listsize:"+listentity.size()); 98 | if (listentity != null) { 99 | for (EntityPlayer i : listentity) { 100 | EntityPlayerMP entityplayermp = (EntityPlayerMP) i; 101 | entityplayermp.connection.sendPacket(new SPacketCustomSound("minecamera:minecamera.kacha", 102 | SoundCategory.BLOCKS, player.posX, player.posY, player.posZ, 1.0F, 1.0F)); 103 | MessageSpawnParticle message2 = new MessageSpawnParticle(); 104 | message2.delay = 200; 105 | message2.typeid = EnumParticleTypes.FIREWORKS_SPARK.getParticleID(); 106 | message2.PosX = particlePosX; 107 | message2.PosY = particlePosY; 108 | message2.PosZ = particlePosZ; 109 | message2.SpeedX = 0; 110 | message2.SpeedY = 0; 111 | message2.SpeedZ = 0; 112 | NetworkLoader.instance.sendTo(message2, entityplayermp); 113 | } 114 | } 115 | } 116 | }); 117 | 118 | 119 | MessageImageSyncSave message2 = new MessageImageSyncSave(); 120 | message2.imageName = imagename; 121 | NetworkLoader.instance.sendTo(message2, player); 122 | return null; 123 | } 124 | } 125 | return null; 126 | } 127 | } 128 | } 129 | -------------------------------------------------------------------------------- /src/main/java/com/porpit/minecamera/network/MessageUpdatePitchYaw.java: -------------------------------------------------------------------------------- 1 | package com.porpit.minecamera.network; 2 | 3 | import com.porpit.minecamera.entity.EntityTripod; 4 | 5 | import io.netty.buffer.ByteBuf; 6 | import net.minecraft.entity.Entity; 7 | import net.minecraft.entity.player.EntityPlayerMP; 8 | import net.minecraftforge.common.DimensionManager; 9 | import net.minecraftforge.fml.common.network.simpleimpl.IMessage; 10 | import net.minecraftforge.fml.common.network.simpleimpl.IMessageHandler; 11 | import net.minecraftforge.fml.common.network.simpleimpl.MessageContext; 12 | import net.minecraftforge.fml.relauncher.Side; 13 | 14 | public class MessageUpdatePitchYaw implements IMessage { 15 | public float rotationYaw; 16 | public float rotationPitch; 17 | 18 | @Override 19 | public void fromBytes(ByteBuf buf) { 20 | rotationYaw = buf.readFloat(); 21 | rotationPitch = buf.readFloat(); 22 | } 23 | 24 | @Override 25 | public void toBytes(ByteBuf buf) { 26 | buf.writeFloat(rotationYaw); 27 | buf.writeFloat(rotationPitch); 28 | } 29 | 30 | public static class Handler implements IMessageHandler { 31 | @Override 32 | public IMessage onMessage(MessageUpdatePitchYaw message, MessageContext ctx) { 33 | if (ctx.side == Side.SERVER) { 34 | EntityPlayerMP player = ctx.getServerHandler().player; 35 | Entity entity =player.getEntityWorld() 36 | .getEntityByID(player.getEntityData().getInteger("renderViewCamera")); 37 | // entity.setDelay(message.delay); 38 | if (player != null && entity != null&&entity instanceof EntityTripod) { 39 | entity.rotationYaw = message.rotationYaw; 40 | entity.rotationPitch = message.rotationPitch; 41 | } 42 | } 43 | return null; 44 | } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/main/java/com/porpit/minecamera/network/NetworkLoader.java: -------------------------------------------------------------------------------- 1 | package com.porpit.minecamera.network; 2 | 3 | import com.porpit.minecamera.MineCamera; 4 | 5 | import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; 6 | import net.minecraftforge.fml.common.network.NetworkRegistry; 7 | import net.minecraftforge.fml.common.network.simpleimpl.IMessage; 8 | import net.minecraftforge.fml.common.network.simpleimpl.IMessageHandler; 9 | import net.minecraftforge.fml.common.network.simpleimpl.SimpleNetworkWrapper; 10 | import net.minecraftforge.fml.relauncher.Side; 11 | 12 | public class NetworkLoader { 13 | public static SimpleNetworkWrapper instance = NetworkRegistry.INSTANCE.newSimpleChannel(MineCamera.MODID); 14 | 15 | private static int nextID = 0; 16 | 17 | public NetworkLoader(FMLPreInitializationEvent event) { 18 | registerMessage(MessageImageSyncSave.Handler.class, MessageImageSyncSave.class, Side.CLIENT); 19 | registerMessage(MessageImage.Handler.class, MessageImage.class, Side.CLIENT); 20 | registerMessage(MessageImage.Handler.class, MessageImage.class, Side.SERVER); 21 | registerMessage(MessageImageRequest.Handler.class, MessageImageRequest.class, Side.SERVER); 22 | registerMessage(MessagePhotoProcessorStart.Handler.class, MessagePhotoProcessorStart.class, Side.SERVER); 23 | registerMessage(MessagePlayerViewRender.Handler.class, MessagePlayerViewRender.class, Side.SERVER); 24 | registerMessage(MessageCameraDelaySet.Handler.class, MessageCameraDelaySet.class, Side.SERVER); 25 | registerMessage(MessageUpdatePitchYaw.Handler.class, MessageUpdatePitchYaw.class, Side.SERVER); 26 | registerMessage(MessageTripodFilmOut.Handler.class, MessageTripodFilmOut.class, Side.SERVER); 27 | registerMessage(MessageSpawnParticle.Handler.class, MessageSpawnParticle.class, Side.CLIENT); 28 | registerMessage(MessageFailLoadImage.Handler.class, MessageFailLoadImage.class, Side.CLIENT); 29 | registerMessage(MessagePictureBookIndex.Handler.class,MessagePictureBookIndex.class,Side.SERVER); 30 | registerMessage(MessagePictureBookInput.Handler.class,MessagePictureBookInput.class,Side.SERVER); 31 | } 32 | 33 | private static void registerMessage( 34 | Class> messageHandler, Class requestMessageType, Side side) { 35 | instance.registerMessage(messageHandler, requestMessageType, nextID++, side); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/com/porpit/minecamera/tileentity/TileEntityLoader.java: -------------------------------------------------------------------------------- 1 | package com.porpit.minecamera.tileentity; 2 | 3 | import com.porpit.minecamera.MineCamera; 4 | 5 | import net.minecraft.tileentity.TileEntity; 6 | import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; 7 | import net.minecraftforge.fml.common.registry.GameRegistry; 8 | 9 | public class TileEntityLoader { 10 | public TileEntityLoader(FMLPreInitializationEvent event) { 11 | registerTileEntity(TileEntityPictureFrame.class, "PictureFrame"); 12 | registerTileEntity(TileEntityPhotoProcessor.class, "PhotoProcessor"); 13 | registerTileEntity(TileEntityPictureFrameMultiple.class, "PictureFrameMultiple"); 14 | } 15 | 16 | public void registerTileEntity(Class tileEntityClass, String id) { 17 | GameRegistry.registerTileEntity(tileEntityClass, MineCamera.MODID + ":" + id); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/com/porpit/minecamera/tileentity/TileEntityPhotoProcessor.java: -------------------------------------------------------------------------------- 1 | package com.porpit.minecamera.tileentity; 2 | 3 | import javax.annotation.Nullable; 4 | 5 | import net.minecraft.block.state.IBlockState; 6 | import net.minecraft.nbt.NBTTagCompound; 7 | import net.minecraft.network.play.server.SPacketUpdateTileEntity; 8 | import net.minecraft.tileentity.TileEntity; 9 | import net.minecraft.util.EnumFacing; 10 | import net.minecraft.util.ITickable; 11 | import net.minecraft.util.math.BlockPos; 12 | import net.minecraft.world.World; 13 | import net.minecraftforge.common.capabilities.Capability; 14 | import net.minecraftforge.items.CapabilityItemHandler; 15 | import net.minecraftforge.items.ItemStackHandler; 16 | 17 | public class TileEntityPhotoProcessor extends TileEntity implements ITickable { 18 | public static int totalburnTime = 440; 19 | protected int burnTime = totalburnTime; 20 | protected ItemStackHandler Inventory = new ItemStackHandler(6){ 21 | @Override 22 | public int getSlotLimit(int slot) { 23 | switch (slot){ 24 | case 0:case 1: 25 | return 10; 26 | case 2: case 4: 27 | return 1; 28 | default: 29 | return 64; 30 | } 31 | } 32 | }; 33 | 34 | public TileEntityPhotoProcessor() { 35 | } 36 | 37 | @Override 38 | public boolean hasCapability(Capability capability, EnumFacing facing) { 39 | if (CapabilityItemHandler.ITEM_HANDLER_CAPABILITY.equals(capability)) { 40 | return true; 41 | } 42 | return super.hasCapability(capability, facing); 43 | } 44 | 45 | @Override 46 | public T getCapability(Capability capability, EnumFacing facing) { 47 | if (CapabilityItemHandler.ITEM_HANDLER_CAPABILITY.equals(capability)) { 48 | @SuppressWarnings("unchecked") 49 | T result = (T) Inventory; 50 | return result; 51 | } 52 | return super.getCapability(capability, facing); 53 | } 54 | 55 | @Override 56 | public void readFromNBT(NBTTagCompound compound) { 57 | super.readFromNBT(compound); 58 | this.Inventory.deserializeNBT(compound.getCompoundTag("Inventory")); 59 | this.burnTime = compound.getInteger("BurnTime"); 60 | } 61 | 62 | @Override 63 | public NBTTagCompound writeToNBT(NBTTagCompound compound) { 64 | super.writeToNBT(compound); 65 | compound.setTag("Inventory", this.Inventory.serializeNBT()); 66 | compound.setInteger("BurnTime", this.burnTime); 67 | return compound; 68 | } 69 | 70 | @Override 71 | public boolean shouldRefresh(World world, BlockPos pos, IBlockState oldState, IBlockState newState) { 72 | return oldState.getBlock() != newState.getBlock(); 73 | } 74 | 75 | public int getBurnTime() { 76 | return burnTime; 77 | } 78 | 79 | @Override 80 | public void update() { 81 | 82 | if (!this.getWorld().isRemote) { 83 | if (this.burnTime < this.totalburnTime) { 84 | this.burnTime++; 85 | if (this.burnTime == this.totalburnTime) { 86 | Inventory.setStackInSlot(4, Inventory.getStackInSlot(5)); 87 | Inventory.extractItem(5, 64, false); 88 | } 89 | } 90 | } 91 | } 92 | 93 | @Override 94 | @Nullable 95 | public SPacketUpdateTileEntity getUpdatePacket() { 96 | return new SPacketUpdateTileEntity(this.pos, 1, this.getUpdateTag()); 97 | } 98 | 99 | @Override 100 | public NBTTagCompound getUpdateTag() { 101 | return this.writeToNBT(new NBTTagCompound()); 102 | } 103 | 104 | public void setBurnTime(int i) { 105 | this.burnTime = i; 106 | } 107 | 108 | } 109 | -------------------------------------------------------------------------------- /src/main/java/com/porpit/minecamera/tileentity/TileEntityPictureFrame.java: -------------------------------------------------------------------------------- 1 | package com.porpit.minecamera.tileentity; 2 | 3 | import javax.annotation.Nullable; 4 | 5 | import com.porpit.minecamera.util.LoadImageFileThread; 6 | import com.porpit.minecamera.util.PictureFactory; 7 | import com.porpit.minecamera.util.VideoMemoryCleaner; 8 | 9 | import net.minecraft.block.state.IBlockState; 10 | import net.minecraft.client.Minecraft; 11 | import net.minecraft.nbt.NBTTagCompound; 12 | import net.minecraft.network.NetworkManager; 13 | import net.minecraft.network.play.server.SPacketUpdateTileEntity; 14 | import net.minecraft.tileentity.TileEntity; 15 | import net.minecraft.util.math.BlockPos; 16 | import net.minecraft.world.World; 17 | import net.minecraftforge.fml.relauncher.Side; 18 | import net.minecraftforge.fml.relauncher.SideOnly; 19 | 20 | public class TileEntityPictureFrame extends TileEntity { 21 | 22 | private int timer; 23 | public int textureID; 24 | public String imagename; 25 | 26 | public TileEntityPictureFrame() { 27 | textureID = -1; 28 | imagename = ""; 29 | } 30 | 31 | public boolean hasImageName() { 32 | return !imagename.equals(""); 33 | } 34 | 35 | public boolean canLoadImage() { 36 | return !PictureFactory.fildToLoadPicture.containsKey(imagename) 37 | && !PictureFactory.lodingPicture.contains(imagename); 38 | } 39 | 40 | public boolean isFailed(){ 41 | return PictureFactory.fildToLoadPicture.containsKey(imagename); 42 | } 43 | 44 | public boolean istextureLoaded() { 45 | timer++; 46 | boolean isLoaded=PictureFactory.loadedPicture.containsKey(imagename); 47 | if(isLoaded){ 48 | textureID=PictureFactory.loadedPicture.get(imagename); 49 | if(timer>=Minecraft.getDebugFPS()){ 50 | timer=0; 51 | VideoMemoryCleaner.activeTexture.add(PictureFactory.loadedPicture.get(imagename)); 52 | } 53 | }else{ 54 | textureID=-1; 55 | } 56 | return isLoaded; 57 | } 58 | 59 | public void loadImage() { 60 | PictureFactory.lodingPicture.add(imagename); 61 | LoadImageFileThread thread = new LoadImageFileThread(imagename); 62 | thread.start(); 63 | } 64 | 65 | @Override 66 | public boolean shouldRefresh(World world, BlockPos pos, IBlockState oldState, IBlockState newState) { 67 | return oldState.getBlock() != newState.getBlock(); 68 | } 69 | 70 | @Override 71 | public void readFromNBT(NBTTagCompound compound) { 72 | super.readFromNBT(compound); 73 | this.imagename = compound.getString("imagename"); 74 | } 75 | 76 | @Override 77 | public NBTTagCompound writeToNBT(NBTTagCompound compound) { 78 | super.writeToNBT(compound); 79 | compound.setString("imagename", this.imagename); 80 | return compound; 81 | } 82 | 83 | @Override 84 | @Nullable 85 | public SPacketUpdateTileEntity getUpdatePacket() { 86 | NBTTagCompound nbt = new NBTTagCompound(); 87 | nbt.setString("imagename", this.imagename); 88 | return new SPacketUpdateTileEntity(this.pos, getBlockMetadata(), nbt); 89 | } 90 | 91 | @Override 92 | public void handleUpdateTag(NBTTagCompound tag) 93 | { 94 | this.readFromNBT(tag); 95 | } 96 | 97 | @Override 98 | @SideOnly(Side.CLIENT) 99 | public void onDataPacket(NetworkManager net, SPacketUpdateTileEntity pkt) 100 | { 101 | this.imagename = pkt.getNbtCompound().getString("imagename"); 102 | System.out.println(this.imagename); 103 | world.markBlockRangeForRenderUpdate(pos, pos); 104 | } 105 | 106 | @Override 107 | public NBTTagCompound getUpdateTag() { 108 | return this.writeToNBT(new NBTTagCompound()); 109 | } 110 | public void updateBlock() 111 | { 112 | if(!world.isRemote) 113 | { 114 | IBlockState state = world.getBlockState(pos); 115 | world.notifyBlockUpdate(pos, state, state, 3); 116 | world.markChunkDirty(getPos(), this); 117 | //worldObj.markBlockForUpdate(pos); 118 | //markDirty(); 119 | } 120 | } 121 | } 122 | -------------------------------------------------------------------------------- /src/main/java/com/porpit/minecamera/tileentity/TileEntityPictureFrameMultiple.java: -------------------------------------------------------------------------------- 1 | package com.porpit.minecamera.tileentity; 2 | 3 | import net.minecraft.nbt.NBTTagCompound; 4 | import net.minecraft.network.NetworkManager; 5 | import net.minecraft.network.play.server.SPacketUpdateTileEntity; 6 | import net.minecraft.tileentity.TileEntity; 7 | import net.minecraftforge.fml.relauncher.Side; 8 | import net.minecraftforge.fml.relauncher.SideOnly; 9 | 10 | public class TileEntityPictureFrameMultiple extends TileEntityPictureFrame { 11 | 12 | public boolean shouldrender; 13 | public int width; 14 | public int height; 15 | 16 | public TileEntityPictureFrameMultiple() { 17 | shouldrender=false; 18 | width=2; 19 | height=2; 20 | } 21 | @Override 22 | public void readFromNBT(NBTTagCompound compound) { 23 | super.readFromNBT(compound); 24 | this.shouldrender=compound.getBoolean("shouldrender"); 25 | this.width = compound.getInteger("width"); 26 | this.height=compound.getInteger("height"); 27 | } 28 | 29 | @Override 30 | public NBTTagCompound writeToNBT(NBTTagCompound compound) { 31 | super.writeToNBT(compound); 32 | compound.setBoolean("shouldrender", shouldrender); 33 | compound.setInteger("width", width); 34 | compound.setInteger("height", height); 35 | return compound; 36 | } 37 | 38 | @Override 39 | public SPacketUpdateTileEntity getUpdatePacket() { 40 | NBTTagCompound nbt = new NBTTagCompound(); 41 | nbt.setString("imagename", this.imagename); 42 | nbt.setBoolean("shouldrender", shouldrender); 43 | nbt.setInteger("width", width); 44 | nbt.setInteger("height", height); 45 | return new SPacketUpdateTileEntity(this.pos, getBlockMetadata(), nbt); 46 | } 47 | 48 | @Override 49 | @SideOnly(Side.CLIENT) 50 | public void onDataPacket(NetworkManager net, SPacketUpdateTileEntity pkt) 51 | { 52 | this.shouldrender=pkt.getNbtCompound().getBoolean("shouldrender"); 53 | this.width = pkt.getNbtCompound().getInteger("width"); 54 | this.height=pkt.getNbtCompound().getInteger("height"); 55 | super.onDataPacket(net, pkt); 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /src/main/java/com/porpit/minecamera/transform/CamDummy.java: -------------------------------------------------------------------------------- 1 | package com.porpit.minecamera.transform; 2 | 3 | import com.google.common.eventbus.EventBus; 4 | 5 | import net.minecraftforge.fml.common.DummyModContainer; 6 | import net.minecraftforge.fml.common.LoadController; 7 | import net.minecraftforge.fml.common.ModMetadata; 8 | 9 | public class CamDummy extends DummyModContainer { 10 | public static final String modid = "MineCameraDummy"; 11 | public static final String version = "1.0.0"; 12 | 13 | public CamDummy() { 14 | super(new ModMetadata()); 15 | ModMetadata meta = getMetadata(); 16 | meta.modId = modid; 17 | meta.name = "MineCameraDummy"; 18 | meta.version = version; 19 | meta.credits = "none"; 20 | meta.authorList.add("none"); 21 | meta.description = ""; 22 | meta.url = ""; 23 | meta.screenshots = new String[0]; 24 | meta.logoFile = ""; 25 | } 26 | 27 | @Override 28 | public boolean registerBus(EventBus bus, LoadController controller) { 29 | 30 | bus.register(this); 31 | return true; 32 | } 33 | } -------------------------------------------------------------------------------- /src/main/java/com/porpit/minecamera/transform/CamEventHandler.java: -------------------------------------------------------------------------------- 1 | package com.porpit.minecamera.transform; 2 | 3 | import net.minecraft.client.Minecraft; 4 | import net.minecraft.entity.Entity; 5 | 6 | public class CamEventHandler { 7 | 8 | public static boolean shouldPlayerTakeInput() { 9 | return true; 10 | } 11 | 12 | public static Minecraft mc = Minecraft.getMinecraft(); 13 | 14 | public static Entity camera = null; 15 | 16 | public static void setupMouseHandlerBefore() { 17 | if (mc.player != null && mc.player.getEntityData().hasKey("renderViewCamera")) { 18 | camera = mc.getRenderViewEntity(); 19 | mc.setRenderViewEntity(mc.player); 20 | } 21 | } 22 | 23 | public static void setupMouseHandlerAfter() { 24 | if (mc.player != null && mc.player.getEntityData().hasKey("renderViewCamera")) { 25 | mc.setRenderViewEntity(camera); 26 | // camera = null; 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/com/porpit/minecamera/transform/CamPatchingLoader.java: -------------------------------------------------------------------------------- 1 | package com.porpit.minecamera.transform; 2 | 3 | import java.io.File; 4 | import java.util.Map; 5 | 6 | import net.minecraftforge.fml.relauncher.IFMLLoadingPlugin; 7 | 8 | @IFMLLoadingPlugin.MCVersion("1.12.2") 9 | public class CamPatchingLoader implements IFMLLoadingPlugin { 10 | 11 | public static File location; 12 | 13 | @Override 14 | public String[] getASMTransformerClass() { 15 | return new String[] { CamTransformer.class.getName() }; 16 | } 17 | 18 | @Override 19 | public String getModContainerClass() { 20 | return CamDummy.class.getName(); 21 | } 22 | 23 | @Override 24 | public String getSetupClass() { 25 | return null; 26 | } 27 | 28 | @Override 29 | public void injectData(Map data) { 30 | location = (File) data.get("coremodLocation"); 31 | TransformerNames.obfuscated = (Boolean) data.get("runtimeDeobfuscationEnabled"); 32 | } 33 | 34 | @Override 35 | public String getAccessTransformerClass() { 36 | return null; 37 | } 38 | 39 | } -------------------------------------------------------------------------------- /src/main/java/com/porpit/minecamera/transform/CamTransformer.java: -------------------------------------------------------------------------------- 1 | package com.porpit.minecamera.transform; 2 | 3 | import static org.objectweb.asm.Opcodes.RETURN; 4 | 5 | import java.util.ArrayList; 6 | import java.util.Iterator; 7 | 8 | import org.objectweb.asm.ClassReader; 9 | import org.objectweb.asm.ClassWriter; 10 | import org.objectweb.asm.Opcodes; 11 | import org.objectweb.asm.tree.AbstractInsnNode; 12 | import org.objectweb.asm.tree.ClassNode; 13 | import org.objectweb.asm.tree.InsnNode; 14 | import org.objectweb.asm.tree.MethodInsnNode; 15 | import org.objectweb.asm.tree.MethodNode; 16 | 17 | import com.porpit.minecamera.MineCamera; 18 | 19 | import net.minecraft.launchwrapper.IClassTransformer; 20 | 21 | public class CamTransformer implements IClassTransformer { 22 | 23 | public CamTransformer() { 24 | initTransformers(); 25 | } 26 | 27 | private final ArrayList transformers = new ArrayList(); 28 | 29 | protected void initTransformers() { 30 | addTransformer(new Transformer("net.minecraft.client.entity.EntityPlayerSP") { 31 | @Override 32 | public void transform(ClassNode node) { 33 | MethodNode m = findMethod(node, "isCurrentViewEntity", "()Z"); 34 | m.instructions.clear(); 35 | m.instructions.add(new MethodInsnNode(Opcodes.INVOKESTATIC, 36 | "com/porpit/minecamera/transform/CamEventHandler", "shouldPlayerTakeInput", "()Z", false)); 37 | m.instructions.add(new InsnNode(Opcodes.IRETURN)); 38 | 39 | } 40 | }); 41 | addTransformer(new Transformer("net.minecraft.client.renderer.EntityRenderer") { 42 | 43 | @Override 44 | public void transform(ClassNode node) { 45 | MethodNode m = findMethod(node, "getMouseOver", "(F)V"); 46 | m.instructions.insert(new MethodInsnNode(Opcodes.INVOKESTATIC, 47 | "com/porpit/minecamera/transform/CamEventHandler", "setupMouseHandlerBefore", "()V", false)); 48 | 49 | AbstractInsnNode currentNode = null; 50 | 51 | @SuppressWarnings("unchecked") 52 | Iterator iter = m.instructions.iterator(); 53 | 54 | while (iter.hasNext()) { 55 | currentNode = iter.next(); 56 | if (currentNode instanceof InsnNode && ((InsnNode) currentNode).getOpcode() == RETURN) { 57 | m.instructions.insertBefore(currentNode, 58 | new MethodInsnNode(Opcodes.INVOKESTATIC, 59 | "com/porpit/minecamera/transform/CamEventHandler", "setupMouseHandlerAfter", 60 | "()V", false)); 61 | } 62 | } 63 | 64 | } 65 | }); 66 | } 67 | 68 | protected void addTransformer(Transformer transformer) { 69 | transformers.add(transformer); 70 | } 71 | 72 | @Override 73 | public byte[] transform(String name, String transformedName, byte[] basicClass) { 74 | if (name.contains("com.porpit")) 75 | return basicClass; 76 | return transform(transformedName, basicClass); 77 | } 78 | 79 | public byte[] transform(String name, byte[] basicClass) { 80 | int i = 0; 81 | while (i < transformers.size()) { 82 | if (transformers.get(i).is(name)) { 83 | ClassNode classNode = new ClassNode(); 84 | ClassReader classReader = new ClassReader(basicClass); 85 | classReader.accept(classNode, 0); 86 | 87 | transformers.get(i).transform(classNode); 88 | 89 | ClassWriter writer = new ClassWriter(ClassWriter.COMPUTE_MAXS + ClassWriter.COMPUTE_FRAMES); 90 | classNode.accept(writer); 91 | basicClass = writer.toByteArray(); 92 | 93 | System.out.println("[" + MineCamera.MODID + "] Patched " + transformers.get(i).className + " ..."); 94 | transformers.get(i).done(); 95 | i++; 96 | // transformers.remove(i); 97 | } else 98 | i++; 99 | } 100 | return basicClass; 101 | } 102 | } 103 | -------------------------------------------------------------------------------- /src/main/java/com/porpit/minecamera/transform/Transformer.java: -------------------------------------------------------------------------------- 1 | package com.porpit.minecamera.transform; 2 | 3 | import java.util.ArrayList; 4 | import java.util.Iterator; 5 | import java.util.ListIterator; 6 | 7 | import javax.annotation.Nullable; 8 | 9 | import org.objectweb.asm.tree.AbstractInsnNode; 10 | import org.objectweb.asm.tree.ClassNode; 11 | import org.objectweb.asm.tree.FieldInsnNode; 12 | import org.objectweb.asm.tree.FieldNode; 13 | import org.objectweb.asm.tree.FrameNode; 14 | import org.objectweb.asm.tree.InsnList; 15 | import org.objectweb.asm.tree.InsnNode; 16 | import org.objectweb.asm.tree.JumpInsnNode; 17 | import org.objectweb.asm.tree.LabelNode; 18 | import org.objectweb.asm.tree.LdcInsnNode; 19 | import org.objectweb.asm.tree.LineNumberNode; 20 | import org.objectweb.asm.tree.LocalVariableNode; 21 | import org.objectweb.asm.tree.MethodInsnNode; 22 | import org.objectweb.asm.tree.MethodNode; 23 | import org.objectweb.asm.tree.TypeInsnNode; 24 | import org.objectweb.asm.tree.VarInsnNode; 25 | 26 | public abstract class Transformer { 27 | 28 | public static ArrayList transformers = new ArrayList(); 29 | 30 | public final String className; 31 | 32 | public Transformer(String className) { 33 | transformers.add(this); 34 | this.className = TransformerNames.patchClassName(className); 35 | } 36 | 37 | public static boolean areNodesEqual(AbstractInsnNode node, AbstractInsnNode node2) { 38 | if (node.getClass() == node2.getClass() && node.getOpcode() == node2.getOpcode()) { 39 | if (node instanceof MethodInsnNode) { 40 | return ((MethodInsnNode) node).name.equals(((MethodInsnNode) node2).name) 41 | && ((MethodInsnNode) node).desc.equals(((MethodInsnNode) node2).desc) 42 | && ((MethodInsnNode) node).owner.equals(((MethodInsnNode) node2).owner); 43 | } else if (node instanceof VarInsnNode) { 44 | return ((VarInsnNode) node).var == ((VarInsnNode) node2).var; 45 | } else if (node instanceof InsnNode) { 46 | return true; 47 | } else if (node instanceof TypeInsnNode) { 48 | return ((TypeInsnNode) node).desc.equals(((TypeInsnNode) node2).desc); 49 | } else if (node instanceof JumpInsnNode) { 50 | return ((JumpInsnNode) node).label == ((JumpInsnNode) node2).label; 51 | } else if (node instanceof LabelNode) { 52 | return node == node2; 53 | } else if (node instanceof LineNumberNode) { 54 | return ((LineNumberNode) node).line == ((LineNumberNode) node2).line; 55 | } else if (node instanceof FieldInsnNode) { 56 | return ((FieldInsnNode) node).name.equals(((FieldInsnNode) node2).name) 57 | && ((FieldInsnNode) node).desc.equals(((FieldInsnNode) node2).desc) 58 | && ((FieldInsnNode) node).owner.equals(((FieldInsnNode) node2).owner); 59 | } else if (node instanceof LdcInsnNode) { 60 | return ((LdcInsnNode) node).cst.equals(((LdcInsnNode) node2).cst); 61 | } 62 | } 63 | return false; 64 | } 65 | 66 | public AbstractInsnNode findNode(InsnList instructions, AbstractInsnNode node) { 67 | ListIterator iterator = instructions.iterator(); 68 | while (iterator.hasNext()) { 69 | AbstractInsnNode insn = iterator.next(); 70 | if (areNodesEqual(insn, node)) { 71 | return insn; 72 | } 73 | } 74 | return null; 75 | } 76 | 77 | public int getIndexOfVar(MethodNode m, String desc, String signature) { 78 | desc = patchDESC(desc); 79 | signature = signature == null ? null : patchDESC(signature); 80 | 81 | for (Iterator iterator = m.localVariables.iterator(); iterator.hasNext();) { 82 | LocalVariableNode local = iterator.next(); 83 | if (local.desc.equals(desc) && (signature == null || signature.equals(local.signature))) 84 | return local.index; 85 | } 86 | return -1; 87 | } 88 | 89 | public int getIndexOfVar(MethodNode m, String desc) { 90 | return getIndexOfVar(m, desc, null); 91 | } 92 | 93 | public LabelNode findPreviousLabel(AbstractInsnNode node) { 94 | while (node.getPrevious() != null) { 95 | if (node.getPrevious() instanceof LabelNode) 96 | return (LabelNode) node.getPrevious(); 97 | node = node.getPrevious(); 98 | } 99 | return null; 100 | } 101 | 102 | public LabelNode findNextLabel(AbstractInsnNode node) { 103 | while (node.getNext() != null) { 104 | if (node.getNext() instanceof LabelNode) 105 | return (LabelNode) node.getNext(); 106 | node = node.getNext(); 107 | } 108 | return null; 109 | } 110 | 111 | public void removeLabel(InsnList instructions, AbstractInsnNode node, int labels) { 112 | replaceLabel(instructions, node, null, labels, false); 113 | } 114 | 115 | public void replaceLabel(InsnList instructions, AbstractInsnNode node, 116 | @Nullable ArrayList replaceInstructions, int labels, boolean keepFirstLabel) { 117 | replaceLabelBefore(instructions, node, replaceInstructions, labels, 0, keepFirstLabel, true); 118 | } 119 | 120 | public void replaceLabelBefore(InsnList instructions, AbstractInsnNode node, 121 | @Nullable ArrayList replaceInstructions, int labels, int labelsBefore, 122 | boolean keepFirstLabel, boolean deleteFrame) { 123 | ListIterator iterator = instructions.iterator(); 124 | LabelNode searchedLabel = null; 125 | ArrayList foundLabels = new ArrayList(); 126 | while (iterator.hasNext()) { 127 | AbstractInsnNode insn = iterator.next(); 128 | if (insn instanceof LabelNode) 129 | foundLabels.add((LabelNode) insn); 130 | if (areNodesEqual(insn, node)) { 131 | int index = foundLabels.size() - 1; 132 | index -= labelsBefore; 133 | if (index >= 0) 134 | searchedLabel = foundLabels.get(index); 135 | labels += labelsBefore; 136 | break; 137 | } 138 | } 139 | 140 | if (searchedLabel != null) { 141 | boolean found = false; 142 | int labelCounter = 0; 143 | iterator = instructions.iterator(); 144 | while (iterator.hasNext()) { 145 | AbstractInsnNode insn = iterator.next(); 146 | if (found && insn instanceof LabelNode) { 147 | labelCounter++; 148 | if (labelCounter >= labels) { 149 | if (replaceInstructions != null) 150 | for (int i = 0; i < replaceInstructions.size(); i++) 151 | instructions.insertBefore(insn, replaceInstructions.get(i)); 152 | break; 153 | } 154 | } 155 | if (insn == searchedLabel) { 156 | found = true; 157 | if (keepFirstLabel) 158 | continue; 159 | } 160 | if (found) 161 | if (deleteFrame || !(insn instanceof FrameNode)) 162 | instructions.remove(insn); 163 | } 164 | } else if (node instanceof LineNumberNode) 165 | System.out.println("COULD NOT FIND NODE line=" + ((LineNumberNode) node).line); 166 | } 167 | 168 | public boolean is(String className) { 169 | return className.equals(this.className); 170 | } 171 | 172 | public String patchDESC(String desc) { 173 | return TransformerNames.patchDESC(desc); 174 | } 175 | 176 | public String patchClassName(String className) { 177 | return TransformerNames.patchClassName(className); 178 | } 179 | 180 | public String patchFieldName(String fieldName) { 181 | return TransformerNames.patchFieldName(fieldName, patchClassName(this.className.replace(".", "/"))); 182 | } 183 | 184 | public String patchMethodName(String methodName, String desc) { 185 | return TransformerNames.patchMethodName(methodName, desc, patchClassName(this.className.replace(".", "/"))); 186 | } 187 | 188 | public abstract void transform(ClassNode node); 189 | 190 | public MethodNode findMethod(ClassNode node, String name, String desc) { 191 | if (TransformerNames.obfuscated) { 192 | name = patchMethodName(name, desc); 193 | desc = patchDESC(desc); 194 | } 195 | Iterator methods = node.methods.iterator(); 196 | while (methods.hasNext()) { 197 | MethodNode m = methods.next(); 198 | if (m.name.equals(name) && m.desc.equals(desc)) 199 | return m; 200 | } 201 | return null; 202 | } 203 | 204 | public FieldNode findField(ClassNode node, String name) { 205 | Iterator fields = node.fields.iterator(); 206 | while (fields.hasNext()) { 207 | FieldNode f = fields.next(); 208 | if (f.name.equals(name)) 209 | return f; 210 | } 211 | return null; 212 | } 213 | 214 | public void done() { 215 | // transformers.remove(this); 216 | if (transformers.size() == 0) 217 | TransformerNames.emptyLists(); 218 | } 219 | } 220 | -------------------------------------------------------------------------------- /src/main/java/com/porpit/minecamera/transform/TransformerNames.java: -------------------------------------------------------------------------------- 1 | package com.porpit.minecamera.transform; 2 | 3 | import java.io.BufferedReader; 4 | import java.io.IOException; 5 | import java.io.InputStreamReader; 6 | import java.util.ArrayList; 7 | import java.util.Comparator; 8 | 9 | public class TransformerNames { 10 | public static boolean obfuscated = false; 11 | 12 | private static ArrayList classes = new ArrayList(); 13 | private static ArrayList methods = new ArrayList(); 14 | private static ArrayList fields = new ArrayList(); 15 | 16 | static { 17 | try { 18 | InputStreamReader reader = new InputStreamReader( 19 | TransformerNames.class.getResourceAsStream("notch-mcp.srg")); 20 | BufferedReader bf = new BufferedReader(reader); 21 | String line = null; 22 | while ((line = bf.readLine()) != null) { 23 | String[] parts = line.split(" "); 24 | if (line.startsWith("CL:")) { 25 | if (parts.length == 3) 26 | classes.add(new ClassName(parts[2], parts[1])); 27 | } else if (line.startsWith("FD:")) { 28 | if (parts.length == 3) { 29 | String[] splitted = parts[2].split("/"); 30 | String name = splitted[splitted.length - 1]; 31 | splitted = parts[1].split("/"); 32 | fields.add(new FieldName(name, splitted[1], splitted[0])); 33 | } 34 | } else if (line.startsWith("MD:")) { 35 | if (parts.length == 5) { 36 | String[] splitted = parts[3].split("/"); 37 | String name = splitted[splitted.length - 1]; 38 | splitted = parts[1].split("/"); 39 | methods.add(new MethodName(name, splitted[1], splitted[0], parts[2])); 40 | } 41 | } 42 | } 43 | 44 | classes.sort(new Comparator() { 45 | 46 | @Override 47 | public int compare(ClassName arg0, ClassName arg1) { 48 | if (arg0.name.length() > arg1.name.length()) 49 | return -1; 50 | if (arg0.name.length() == arg1.name.length()) 51 | return 0; 52 | return 1; 53 | } 54 | 55 | }); 56 | } catch (IOException e) { 57 | e.printStackTrace(); 58 | } 59 | } 60 | 61 | public static void emptyLists() { 62 | classes.clear(); 63 | fields.clear(); 64 | methods.clear(); 65 | } 66 | 67 | public static String patchDESC(String desc) { 68 | if (obfuscated) 69 | for (int i = 0; i < classes.size(); i++) 70 | desc = desc.replace(classes.get(i).name, classes.get(i).obfname); 71 | return desc; 72 | } 73 | 74 | public static String patchClassName(String className) { 75 | if (obfuscated) 76 | for (int i = 0; i < classes.size(); i++) 77 | if (className.equals(classes.get(i).name)) 78 | return classes.get(i).obfname; 79 | return className; 80 | } 81 | 82 | public static String patchFieldName(String fieldName, Class parent) { 83 | return patchFieldName(fieldName, patchClassName(parent.getName())); 84 | } 85 | 86 | public static String patchFieldName(String fieldName, String parentName) { 87 | if (obfuscated) { 88 | for (int i = 0; i < fields.size(); i++) 89 | if (fieldName.equals(fields.get(i).name) && parentName.equals(fields.get(i).parent)) 90 | return fields.get(i).obfname; 91 | } 92 | return fieldName; 93 | } 94 | 95 | public static String patchMethodName(String methodName, String desc, Class parent) { 96 | return patchMethodName(methodName, desc, patchClassName(parent.getName())); 97 | } 98 | 99 | public static String patchMethodName(String methodName, String desc, String parentName) { 100 | if (obfuscated) { 101 | String obfdesc = patchDESC(desc); 102 | for (int i = 0; i < methods.size(); i++) 103 | if (methodName.equals(methods.get(i).name) && parentName.equals(methods.get(i).parent) 104 | && methods.get(i).desc.equals(obfdesc)) 105 | return methods.get(i).obfname; 106 | } 107 | return methodName; 108 | } 109 | 110 | private static class ClassName { 111 | public final String name; 112 | public final String obfname; 113 | 114 | public ClassName(String name, String obfname) { 115 | this.name = name; 116 | this.obfname = obfname; 117 | } 118 | } 119 | 120 | private static class FieldName extends ClassName { 121 | 122 | public FieldName(String name, String obfname, String parent) { 123 | super(name, obfname); 124 | this.parent = parent; 125 | } 126 | 127 | public final String parent; 128 | } 129 | 130 | private static class MethodName extends FieldName { 131 | 132 | public final String desc; 133 | 134 | public MethodName(String name, String obfname, String parent, String desc) { 135 | super(name, obfname, parent); 136 | this.desc = desc; 137 | } 138 | 139 | } 140 | 141 | } 142 | -------------------------------------------------------------------------------- /src/main/java/com/porpit/minecamera/util/EnumFailLoadImage.java: -------------------------------------------------------------------------------- 1 | package com.porpit.minecamera.util; 2 | 3 | public enum EnumFailLoadImage { 4 | FileNoFound,ErrorToLoadFile,ErrorToLoadLocalFile; 5 | } 6 | -------------------------------------------------------------------------------- /src/main/java/com/porpit/minecamera/util/LoadImageFileThread.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PorPit/MineCamera/d52eb883f2af9a8f66cf183060898c7672c9a471/src/main/java/com/porpit/minecamera/util/LoadImageFileThread.java -------------------------------------------------------------------------------- /src/main/java/com/porpit/minecamera/util/PictureFactory.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PorPit/MineCamera/d52eb883f2af9a8f66cf183060898c7672c9a471/src/main/java/com/porpit/minecamera/util/PictureFactory.java -------------------------------------------------------------------------------- /src/main/java/com/porpit/minecamera/util/SaveImageThread.java: -------------------------------------------------------------------------------- 1 | package com.porpit.minecamera.util; 2 | 3 | import java.awt.image.BufferedImage; 4 | import java.io.File; 5 | import java.io.IOException; 6 | 7 | import javax.imageio.ImageIO; 8 | 9 | import com.porpit.minecamera.MineCamera; 10 | 11 | import net.minecraft.client.Minecraft; 12 | 13 | public class SaveImageThread extends Thread { 14 | String filename; 15 | BufferedImage screenshot; 16 | 17 | public SaveImageThread(String filename) { 18 | this.filename = filename; 19 | } 20 | 21 | public void run() { 22 | if (!Minecraft.getMinecraft().gameSettings.hideGUI) { 23 | Minecraft.getMinecraft().gameSettings.hideGUI = true; 24 | try { 25 | Thread.sleep(50); 26 | } catch (InterruptedException e) { 27 | e.printStackTrace(); 28 | } 29 | Minecraft.getMinecraft().addScheduledTask(new Runnable() { 30 | @Override 31 | public void run() { 32 | screenshot = PictureFactory.getFormattingScreenshot(); 33 | Minecraft.getMinecraft().gameSettings.hideGUI = false; 34 | File file = new File(MineCamera.ClientCatchFile + filename + ".jpeg"); 35 | try { 36 | if (!file.getParentFile().exists()) { 37 | file.getParentFile().mkdirs(); 38 | } 39 | if (!file.exists()) { 40 | file.createNewFile(); 41 | } 42 | ImageIO.write(screenshot, "jpg", file); 43 | } catch (IOException e) { 44 | e.printStackTrace(); 45 | } 46 | PictureFactory.SendImageToServer(screenshot, filename); 47 | } 48 | }); 49 | } else { 50 | Minecraft.getMinecraft().addScheduledTask(new Runnable() { 51 | @Override 52 | public void run() { 53 | try { 54 | screenshot = PictureFactory.getFormattingScreenshot(); 55 | File file = new File(MineCamera.ClientCatchFile + filename + ".jpeg"); 56 | if (!file.getParentFile().exists()) { 57 | file.getParentFile().mkdirs(); 58 | } 59 | if (!file.exists()) { 60 | file.createNewFile(); 61 | } 62 | ImageIO.write(screenshot, "jpg", file); 63 | } catch (Exception e) { 64 | e.printStackTrace(); 65 | } 66 | PictureFactory.SendImageToServer(screenshot, filename); 67 | } 68 | }); 69 | } 70 | } 71 | } -------------------------------------------------------------------------------- /src/main/java/com/porpit/minecamera/util/TripodActiveThread.java: -------------------------------------------------------------------------------- 1 | package com.porpit.minecamera.util; 2 | 3 | import com.porpit.minecamera.network.MessageTripodFilmOut; 4 | import com.porpit.minecamera.network.NetworkLoader; 5 | 6 | import net.minecraft.client.Minecraft; 7 | import net.minecraft.util.text.TextComponentTranslation; 8 | 9 | public class TripodActiveThread extends Thread { 10 | public static boolean isshooting = false; 11 | private String playername; 12 | private int delay; 13 | 14 | public TripodActiveThread(String playername, int delay) { 15 | this.playername = playername; 16 | this.delay = delay; 17 | } 18 | 19 | public void run() { 20 | synchronized(this){ 21 | isshooting = true; 22 | } 23 | try { 24 | for (int i = delay; i > 0; i--) { 25 | Minecraft.getMinecraft().player 26 | .sendMessage(new TextComponentTranslation("chat.minecamera.delayinfo", i)); 27 | 28 | Thread.sleep(1000); 29 | 30 | if (!Minecraft.getMinecraft().player.getEntityData().hasKey("renderViewCamera")) { 31 | Minecraft.getMinecraft().player 32 | .sendMessage(new TextComponentTranslation("chat.minecamera.leavetripod")); 33 | isshooting = false; 34 | return; 35 | } 36 | } 37 | Minecraft.getMinecraft().player 38 | .sendMessage(new TextComponentTranslation("chat.minecamera.trytoshoot")); 39 | } catch (InterruptedException e) { 40 | isshooting = false; 41 | e.printStackTrace(); 42 | } 43 | MessageTripodFilmOut message = new MessageTripodFilmOut(); 44 | NetworkLoader.instance.sendToServer(message); 45 | 46 | isshooting = false; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /src/main/java/com/porpit/minecamera/util/VideoMemoryCleaner.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PorPit/MineCamera/d52eb883f2af9a8f66cf183060898c7672c9a471/src/main/java/com/porpit/minecamera/util/VideoMemoryCleaner.java -------------------------------------------------------------------------------- /src/main/resources/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | FMLCorePlugin: com.porpit.minecamera.transform.CamPatchingLoader 3 | FMLCorePluginContainsFMLMod: com.porpit.minecamera.transform.CamDummy 4 | ForceLoadAsMod: true -------------------------------------------------------------------------------- /src/main/resources/assets/minecamera/advancements/default/craftcamera.json: -------------------------------------------------------------------------------- 1 | { 2 | "display": { 3 | "icon": { 4 | "item": "minecamera:camera" 5 | }, 6 | "title": { 7 | "translate": "achievement.minecamera.craftcamera" 8 | }, 9 | "description": { 10 | "translate": "achievement.minecamera.craftcamera.desc" 11 | }, 12 | "frame": "challenge" 13 | }, 14 | "parent": "minecamera:default/root", 15 | "criteria": { 16 | "minecamera_craftcamera": { 17 | "trigger": "minecraft:inventory_changed", 18 | "conditions": { 19 | "items": [ 20 | { 21 | "item": "minecamera:camera" 22 | } 23 | ] 24 | } 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /src/main/resources/assets/minecamera/advancements/default/craftcrafttripod.json: -------------------------------------------------------------------------------- 1 | { 2 | "display": { 3 | "icon": { 4 | "item": "minecamera:tripod" 5 | }, 6 | "title": { 7 | "translate": "achievement.minecamera.crafttripod" 8 | }, 9 | "description": { 10 | "translate": "achievement.minecamera.crafttripod.desc" 11 | }, 12 | "frame": "challenge" 13 | }, 14 | "parent": "minecamera:default/craftcamera", 15 | "criteria": { 16 | "minecamera_crafttripod": { 17 | "trigger": "minecraft:inventory_changed", 18 | "conditions": { 19 | "items": [ 20 | { 21 | "item": "minecamera:tripod" 22 | } 23 | ] 24 | } 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /src/main/resources/assets/minecamera/advancements/default/craftfilm.json: -------------------------------------------------------------------------------- 1 | { 2 | "display": { 3 | "icon": { 4 | "item": "minecamera:film" 5 | }, 6 | "title": { 7 | "translate": "achievement.minecamera.craftfilm" 8 | }, 9 | "description": { 10 | "translate": "achievement.minecamera.craftfilm.desc" 11 | }, 12 | "frame": "challenge" 13 | }, 14 | "parent": "minecamera:default/craftcamera", 15 | "criteria": { 16 | "minecamera_craftfilm": { 17 | "trigger": "minecraft:inventory_changed", 18 | "conditions": { 19 | "items": [ 20 | { 21 | "item": "minecamera:film" 22 | } 23 | ] 24 | } 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /src/main/resources/assets/minecamera/advancements/default/craftglasses.json: -------------------------------------------------------------------------------- 1 | { 2 | "display": { 3 | "icon": { 4 | "item": "minecamera:glasses_helmet" 5 | }, 6 | "title": { 7 | "translate": "achievement.minecamera.craftglasses" 8 | }, 9 | "description": { 10 | "translate": "achievement.minecamera.craftglasses.desc" 11 | }, 12 | "frame": "challenge" 13 | }, 14 | "parent": "minecamera:default/root", 15 | "criteria": { 16 | "minecamera_craftglasses": { 17 | "trigger": "minecraft:inventory_changed", 18 | "conditions": { 19 | "items": [ 20 | { 21 | "item": "minecamera:glasses_helmet" 22 | } 23 | ] 24 | } 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /src/main/resources/assets/minecamera/advancements/default/craftphoto_paper.json: -------------------------------------------------------------------------------- 1 | { 2 | "display": { 3 | "icon": { 4 | "item": "minecamera:photo_paper" 5 | }, 6 | "title": { 7 | "translate": "achievement.minecamera.craftphoto_paper" 8 | }, 9 | "description": { 10 | "translate": "achievement.minecamera.craftphoto_paper.desc" 11 | }, 12 | "frame": "challenge" 13 | }, 14 | "parent": "minecamera:default/craftcamera", 15 | "criteria": { 16 | "minecamera_craftphoto_paper": { 17 | "trigger": "minecraft:inventory_changed", 18 | "conditions": { 19 | "items": [ 20 | { 21 | "item": "minecamera:photo_paper" 22 | } 23 | ] 24 | } 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /src/main/resources/assets/minecamera/advancements/default/craftpicture.json: -------------------------------------------------------------------------------- 1 | { 2 | "display": { 3 | "icon": { 4 | "item": "minecamera:picture" 5 | }, 6 | "title": { 7 | "translate": "achievement.minecamera.craftpicture" 8 | }, 9 | "description": { 10 | "translate": "achievement.minecamera.craftpicture.desc" 11 | }, 12 | "frame": "challenge" 13 | }, 14 | "parent": "minecamera:default/craftprocessor", 15 | "criteria": { 16 | "minecamera_craftpicture": { 17 | "trigger": "minecraft:inventory_changed", 18 | "conditions": { 19 | "items": [ 20 | { 21 | "item": "minecamera:picture" 22 | } 23 | ] 24 | } 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /src/main/resources/assets/minecamera/advancements/default/craftpicture_book.json: -------------------------------------------------------------------------------- 1 | { 2 | "display": { 3 | "icon": { 4 | "item": "minecamera:picture_book" 5 | }, 6 | "title": { 7 | "translate": "achievement.minecamera.craftpicture_book" 8 | }, 9 | "description": { 10 | "translate": "achievement.minecamera.craftpicture_book.desc" 11 | }, 12 | "frame": "challenge" 13 | }, 14 | "parent": "minecamera:default/root", 15 | "criteria": { 16 | "minecamera_craftpicture_book": { 17 | "trigger": "minecraft:inventory_changed", 18 | "conditions": { 19 | "items": [ 20 | { 21 | "item": "minecamera:picture_book" 22 | } 23 | ] 24 | } 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /src/main/resources/assets/minecamera/advancements/default/craftpictureframe.json: -------------------------------------------------------------------------------- 1 | { 2 | "display": { 3 | "icon": { 4 | "item": "minecamera:pictureframe" 5 | }, 6 | "title": { 7 | "translate": "achievement.minecamera.craftpictureframe" 8 | }, 9 | "description": { 10 | "translate": "achievement.minecamera.craftpictureframe.desc" 11 | }, 12 | "frame": "challenge" 13 | }, 14 | "parent": "minecamera:default/root", 15 | "criteria": { 16 | "minecamera_craftpictureframe": { 17 | "trigger": "minecraft:inventory_changed", 18 | "conditions": { 19 | "items": [ 20 | { 21 | "item": "minecamera:pictureframe" 22 | } 23 | ] 24 | } 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /src/main/resources/assets/minecamera/advancements/default/craftpictureframe_multiple.json: -------------------------------------------------------------------------------- 1 | { 2 | "display": { 3 | "icon": { 4 | "item": "minecamera:pictureframe_multiple" 5 | }, 6 | "title": { 7 | "translate": "achievement.minecamera.craftpictureframe_multiple" 8 | }, 9 | "description": { 10 | "translate": "achievement.minecamera.craftpictureframe_multiple.desc" 11 | }, 12 | "frame": "challenge" 13 | }, 14 | "parent": "minecamera:default/craftpictureframe", 15 | "criteria": { 16 | "minecamera_craftpictureframe_multiple": { 17 | "trigger": "minecraft:inventory_changed", 18 | "conditions": { 19 | "items": [ 20 | { 21 | "item": "minecamera:pictureframe_multiple" 22 | } 23 | ] 24 | } 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /src/main/resources/assets/minecamera/advancements/default/craftprocessor.json: -------------------------------------------------------------------------------- 1 | { 2 | "display": { 3 | "icon": { 4 | "item": "minecamera:photoprocessor" 5 | }, 6 | "title": { 7 | "translate": "achievement.minecamera.craftprocessor" 8 | }, 9 | "description": { 10 | "translate": "achievement.minecamera.craftprocessor.desc" 11 | }, 12 | "frame": "challenge" 13 | }, 14 | "parent": "minecamera:default/root", 15 | "criteria": { 16 | "minecamera_craftprocessor": { 17 | "trigger": "minecraft:inventory_changed", 18 | "conditions": { 19 | "items": [ 20 | { 21 | "item": "minecamera:photoprocessor" 22 | } 23 | ] 24 | } 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /src/main/resources/assets/minecamera/advancements/default/root.json: -------------------------------------------------------------------------------- 1 | { 2 | "display": { 3 | "icon": { 4 | "item": "minecamera:camera" 5 | }, 6 | "title": { 7 | "translate": "achievement.minecamera.start" 8 | }, 9 | "description": { 10 | "translate": "achievement.minecamera.start.desc" 11 | }, 12 | "background": "minecamera:textures/gui/image/advancement_bg.png", 13 | "frame": "challenge" 14 | }, 15 | "criteria": { 16 | "uhc_start": { 17 | "trigger": "minecraft:tick" 18 | } 19 | } 20 | } -------------------------------------------------------------------------------- /src/main/resources/assets/minecamera/blockstates/photoprocessor.json: -------------------------------------------------------------------------------- 1 | { 2 | "variants": { 3 | "facing=north": { "model": "minecamera:photoprocessor"}, 4 | "facing=east": { "model": "minecamera:photoprocessor" ,"y": 90}, 5 | "facing=south": { "model": "minecamera:photoprocessor" ,"y": 180}, 6 | "facing=west": { "model": "minecamera:photoprocessor" ,"y": 270} 7 | } 8 | } -------------------------------------------------------------------------------- /src/main/resources/assets/minecamera/blockstates/pictureframe.json: -------------------------------------------------------------------------------- 1 | { 2 | "variants": { 3 | "facing=north,statetype=standing": { "model": "minecamera:pictureframestand"}, 4 | "facing=east,statetype=standing": { "model": "minecamera:pictureframestand" ,"y": 90, "uvlock": true }, 5 | "facing=south,statetype=standing": { "model": "minecamera:pictureframestand" ,"y": 180, "uvlock": true }, 6 | "facing=west,statetype=standing": { "model": "minecamera:pictureframestand" ,"y": 270, "uvlock": true }, 7 | "facing=north,statetype=hanging": { "model": "minecamera:pictureframe"}, 8 | "facing=east,statetype=hanging": { "model": "minecamera:pictureframe" ,"y": 90, "uvlock": true }, 9 | "facing=south,statetype=hanging": { "model": "minecamera:pictureframe" ,"y": 180, "uvlock": true }, 10 | "facing=west,statetype=hanging": { "model": "minecamera:pictureframe" ,"y": 270, "uvlock": true } 11 | } 12 | } -------------------------------------------------------------------------------- /src/main/resources/assets/minecamera/blockstates/pictureframe_multiple.json: -------------------------------------------------------------------------------- 1 | { 2 | "multipart": [ 3 | { "when": { "rendertype": 0 ,"facing": "north"}, 4 | "apply": { "model": "minecamera:pictureframe_multiple_mid"} 5 | }, 6 | { "when": { "rendertype": 0 ,"facing": "east"}, 7 | "apply": { "model": "minecamera:pictureframe_multiple_mid","y": 90} 8 | }, 9 | { "when": { "rendertype": 0 ,"facing": "south"}, 10 | "apply": { "model": "minecamera:pictureframe_multiple_mid","y": 180} 11 | }, 12 | { "when": { "rendertype": 0 ,"facing": "west"}, 13 | "apply": { "model": "minecamera:pictureframe_multiple_mid","y": 270} 14 | }, 15 | { "when": { "rendertype": 1 ,"facing": "north"}, 16 | "apply": { "model": "minecamera:pictureframe_multiple_corner"} 17 | }, 18 | { "when": { "rendertype": 1 ,"facing": "east"}, 19 | "apply": { "model": "minecamera:pictureframe_multiple_corner" ,"y": 90} 20 | }, 21 | { "when": { "rendertype": 1 ,"facing": "south"}, 22 | "apply": { "model": "minecamera:pictureframe_multiple_corner" ,"y": 180} 23 | }, 24 | { "when": { "rendertype": 1 ,"facing": "west"}, 25 | "apply": { "model": "minecamera:pictureframe_multiple_corner" ,"y": 270} 26 | }, 27 | { "when": { "rendertype": 2 ,"facing": "north"}, 28 | "apply": { "model": "minecamera:pictureframe_multiple_corner_1" ,"y":180 ,"x": 180} 29 | }, 30 | { "when": { "rendertype": 2 ,"facing": "east"}, 31 | "apply": { "model": "minecamera:pictureframe_multiple_corner_1" ,"y": 270,"x": 180} 32 | }, 33 | { "when": { "rendertype": 2 ,"facing": "south"}, 34 | "apply": { "model": "minecamera:pictureframe_multiple_corner_1" ,"y": 0,"x": 180} 35 | }, 36 | { "when": { "rendertype": 2 ,"facing": "west"}, 37 | "apply": { "model": "minecamera:pictureframe_multiple_corner_1" ,"y": 90,"x": 180} 38 | }, 39 | { "when": { "rendertype": 3 ,"facing": "north"}, 40 | "apply": { "model": "minecamera:pictureframe_multiple_corner" ,"y":180 ,"x": 180} 41 | }, 42 | { "when": { "rendertype": 3 ,"facing": "east"}, 43 | "apply": { "model": "minecamera:pictureframe_multiple_corner" ,"y": 270,"x": 180} 44 | }, 45 | { "when": { "rendertype": 3 ,"facing": "south"}, 46 | "apply": { "model": "minecamera:pictureframe_multiple_corner" ,"y": 0,"x": 180} 47 | }, 48 | { "when": { "rendertype": 3 ,"facing": "west"}, 49 | "apply": { "model": "minecamera:pictureframe_multiple_corner" ,"y": 90,"x": 180} 50 | }, 51 | { "when": { "rendertype": 4 ,"facing": "north"}, 52 | "apply": { "model": "minecamera:pictureframe_multiple_corner_1"} 53 | }, 54 | { "when": { "rendertype": 4 ,"facing": "east"}, 55 | "apply": { "model": "minecamera:pictureframe_multiple_corner_1" ,"y": 90} 56 | }, 57 | { "when": { "rendertype": 4 ,"facing": "south"}, 58 | "apply": { "model": "minecamera:pictureframe_multiple_corner_1" ,"y": 180} 59 | }, 60 | { "when": { "rendertype": 4 ,"facing": "west"}, 61 | "apply": { "model": "minecamera:pictureframe_multiple_corner_1" ,"y": 270} 62 | }, 63 | { "when": { "rendertype": 5 ,"facing": "north"}, 64 | "apply": { "model": "minecamera:pictureframe_multiple_edge"} 65 | }, 66 | { "when": { "rendertype": 5 ,"facing": "east"}, 67 | "apply": { "model": "minecamera:pictureframe_multiple_edge","y":90} 68 | }, 69 | { "when": { "rendertype": 5 ,"facing": "south"}, 70 | "apply": { "model": "minecamera:pictureframe_multiple_edge","y":180} 71 | }, 72 | { "when": { "rendertype": 5 ,"facing": "west"}, 73 | "apply": { "model": "minecamera:pictureframe_multiple_edge","y":270} 74 | }, 75 | { "when": { "rendertype": 6 ,"facing": "north"}, 76 | "apply": { "model": "minecamera:pictureframe_multiple_edge_1", "y": 180,"x": 180} 77 | }, 78 | { "when": { "rendertype": 6 ,"facing": "east"}, 79 | "apply": { "model": "minecamera:pictureframe_multiple_edge_1", "y": 270,"x": 180} 80 | }, 81 | { "when": { "rendertype": 6 ,"facing": "south"}, 82 | "apply": { "model": "minecamera:pictureframe_multiple_edge_1", "y": 0,"x": 180} 83 | }, 84 | { "when": { "rendertype": 6 ,"facing": "west"}, 85 | "apply": { "model": "minecamera:pictureframe_multiple_edge_1", "y": 90,"x": 180} 86 | }, 87 | { "when": { "rendertype": 7 ,"facing": "north"}, 88 | "apply": { "model": "minecamera:pictureframe_multiple_edge", "y": 180,"x": 180} 89 | }, 90 | { "when": { "rendertype": 7 ,"facing": "east"}, 91 | "apply": { "model": "minecamera:pictureframe_multiple_edge", "y": 270,"x": 180} 92 | }, 93 | { "when": { "rendertype": 7 ,"facing": "south"}, 94 | "apply": { "model": "minecamera:pictureframe_multiple_edge", "y": 0,"x": 180} 95 | }, 96 | { "when": { "rendertype": 7 ,"facing": "west"}, 97 | "apply": { "model": "minecamera:pictureframe_multiple_edge", "y": 90,"x": 180} 98 | }, 99 | { "when": { "rendertype": 8 ,"facing": "north"}, 100 | "apply": { "model": "minecamera:pictureframe_multiple_edge_1"} 101 | }, 102 | { "when": { "rendertype": 8 ,"facing": "east"}, 103 | "apply": { "model": "minecamera:pictureframe_multiple_edge_1","y": 90} 104 | }, 105 | { "when": { "rendertype": 8 ,"facing": "south"}, 106 | "apply": { "model": "minecamera:pictureframe_multiple_edge_1","y": 180} 107 | }, 108 | { "when": { "rendertype": 8 ,"facing": "west"}, 109 | "apply": { "model": "minecamera:pictureframe_multiple_edge_1","y": 270} 110 | } 111 | ] 112 | } -------------------------------------------------------------------------------- /src/main/resources/assets/minecamera/lang/en_US.lang: -------------------------------------------------------------------------------- 1 | gui.camgameoverlay.unlocked=Control Mode:tripod(press CTRL to change) 2 | gui.camgameoverlay.locked=Control Mode:player(press CTRL to change) 3 | 4 | container.camera.text.outing=processing...... 5 | container.camera.text.delay=delay 6 | 7 | text.info.FileNoFound=File not found!Can not load picture. 8 | text.info.ErrorToLoadFile=Error to load ServerFile,can't load picture. 9 | text.info.ErrorToLoadLocalFile=Error to load LocalFile,please restart to load picture. 10 | 11 | container.picture_book.text.inputinfo=Put in the picture 12 | container.picture_book.text.pictureindex=Page: 13 | container.picture_book.text.totalpicturenum=Total pages: 14 | container.picture_book.text.owner=Creator: 15 | container.picture_book.text.time=Time: 16 | container.picture_book.text.error=Error!no information. 17 | 18 | container.photoprocessor.button.start=Start! 19 | container.photoprocessor.text.success=Process successfully!Please take out the picture. 20 | container.photoprocessor.text.default=Please put in the materials and press the Start to process picture. 21 | container.photoprocessor.text.nonectl=No homothermal liquid! 22 | container.photoprocessor.text.noneda=No developing liquid! 23 | container.photoprocessor.text.nonepaper=No paper! 24 | container.photoprocessor.text.nonefilm=No film! 25 | container.photoprocessor.text.hasphotoout=There a film has been processed,please take it out first. 26 | container.photoprocessor.text.outing=Processing...... 27 | container.photoprocessor.text.readsuccess=Load successfully!The creator of film is: 28 | container.photoprocessor.text.lightleveltoohigh=The Lightlevel too high!Can't process picture.(must be less than 5) 29 | container.photoprocessor.text.lodingfilm=Loading...... 30 | container.photoprocessor.text.failed.FileNoFound=File not found!Can not process picture. 31 | container.photoprocessor.text.failed.ErrorToLoadFile=Error to load ServerFile,can't process picture. 32 | container.photoprocessor.text.failed.ErrorToLoadLocalFile=Error to load LocalFile,please restart to process picture. 33 | container.photoprocessor.text.lightlevel=Lightlevel: 34 | 35 | chat.minecamera.isshooting=Please don't operate the camera over and over again quickly. 36 | chat.minecamera.delayinfo=will shoot in %1$s s 37 | chat.minecamera.leavetripod=Out of controling!stop to shoot. 38 | chat.minecamera.trytoshoot=Trying to shoot.... 39 | 40 | chat.framemultiple.mustusehead=Please right click the Bottom Left of the pictureframe to place the picture. 41 | chat.framemultiple.widthbuildtoomore=Too Wide!The Limit:%1$s 42 | chat.framemultiple.heightbuildtoomore=Too high!The Limit:%1$s 43 | chat.framemultiple.failmultipleplace=Fail to place it.The length and width aren't enough(at least 3 in length,7 in width),or too close to another pictureframe(at least 1 block). 44 | chat.framemultiple.changeanddrowpicture=You changed the size of pictureframe,the photo has been dropped,please pick it up by yourself. 45 | chat.framemultiple.widthorheighttoosmall=The length and width of a pictureframe must be equal or greater than 2. 46 | chat.framemultiple.failedtobuild=The pictureframe must be a quadrangle. 47 | chat.framemultiple.removeuselesspart=The redundant parts of pictureframe have been removed already. 48 | 49 | itemGroup.minecamera=Minecamera 50 | 51 | item.glasses_helmet.name=glasses 52 | item.camera.name=camera 53 | item.picture.name=picture 54 | item.battery.name=AA battery 55 | item.film.name=film 56 | item.tripod.name=camera with tripod 57 | item.cnst_temp_liquid.name=homothermal liquid 58 | item.developing_agent.name=developing liquid 59 | item.photo_paper.name=sensitized paper 60 | item.picture_book.name=picturebook 61 | 62 | 63 | tile.pictureframe.name=pictureframe 64 | tile.photoprocessor.name=photoprocessor 65 | tile.pictureframe_multiple.name=multiple pictureframe 66 | 67 | 68 | lore.pictureframe.info=A tiny pictureframe can be placed on the block or placed on the wall. 69 | lore.pictureframe_multiple.info=The pictureframe can self-merge by placing another one near it. 70 | lore.pictureframe_multiple.info2=Hold SHIFT and Right click can quickly place the 3x2 size. 71 | lore.pictureframe_multiple.info3=Hold SHIFT and break the picture the pictureframe can break the whole pictureframe. 72 | 73 | lore.glasses_helmet.info=Use the glasses can change the vision with camera. 74 | lore.glasses_helmet.info2="It's said wearing this glasses can live up to 200 years old?" 75 | 76 | lore.liquid.damage=Dose: 77 | lore.battery.damage=Power: 78 | 79 | lore.battery.info="It's full of energy!" 80 | 81 | 82 | lore.picture.null=No information 83 | lore.picture.author=Creator: 84 | lore.picture.noauthor=This picture isn't used by player. 85 | lore.picture.time=Time 86 | 87 | lore.film.author=Creator: 88 | lore.film.time=Time: 89 | lore.film.info=Info: 90 | lore.film.info.used=used 91 | lore.film.info.unused=unused 92 | 93 | lore.tripod.info=Can place on the ground take a photo. 94 | lore.tripod.info2=And use the glasses to change the vision with camera. 95 | 96 | lore.picturebook.info=The Amount of photos: 97 | 98 | chat.tripod.mustuseglass=You must wear the glasses to exchange vision with camera. 99 | chat.tripod.mustup=The tripod must be placed on the ground. 100 | chat.tripod.info=Press the CTRL to change the mode. SHIFT to leave the camera. 101 | 102 | chat.minecamera.isouting=The used-film hasn't processed,please open the camera to process it. 103 | chat.minecamera.nofilm=Please put the film in the camera to take photos. 104 | chat.minecamera.hasfilmout=You should take out the used-film. 105 | chat.minecamera.nobettery=Please put the battery in the camera to take photos. 106 | chat.minecamera.filmcantwrite=This film has used already. 107 | chat.minecamera.betteryrunout=Ran out of electricity! 108 | chat.minecamera.success=Succesfully shoot,open the camera to process it. 109 | 110 | chat.picturebook.tomany=Can't add the photo because the picturebook is full. 111 | 112 | achievement.minecamera.start=Setup! 113 | achievement.minecamera.start.desc=Thanks for setuping The MineCamera Mod! 114 | achievement.minecamera.craftcamera=Nostalgic Photographer 115 | achievement.minecamera.craftcamera.desc=It's surpised to use a Film Camera nowadays! 116 | achievement.minecamera.craftprocessor=Trying an old technology! 117 | achievement.minecamera.craftprocessor.desc=I can hardly see someone develop photos with film nowadays. 118 | achievement.minecamera.craftfilm=Long time no see!The film! 119 | achievement.minecamera.craftfilm.desc=Please don't forget it that will disappear. 120 | achievement.minecamera.craftphoto_paper=Sensitized paper technology. 121 | achievement.minecamera.craftphoto_paper.desc=Don't forget him in nowadays that printing technology is widely useing. 122 | achievement.minecamera.craftpictureframe=Re-remember Machine 123 | achievement.minecamera.craftpictureframe.desc=A photo contains so many things.I's important to remind you of your memories. 124 | achievement.minecamera.craftpictureframe_multiple=The photo wall 125 | achievement.minecamera.craftpictureframe_multiple.desc=Let one of your walls become your reminiscence. 126 | achievement.minecamera.crafttripod=Try to shoot with a tripod. 127 | achievement.minecamera.crafttripod.desc=Enjoy it alone or take photos with your friends. 128 | achievement.minecamera.craftglasses=Be bored about run? 129 | achievement.minecamera.craftglasses.desc=Try to feel the charm of shooting with a tripod. 130 | achievement.minecamera.craftpicture_book=A heavy book. 131 | achievement.minecamera.craftpicture_book.desc=A book that contained your memories. 132 | achievement.minecamera.craftpicture=The memories with color. 133 | achievement.minecamera.craftpicture.desc=Or you can make a book to collect your memories well? 134 | 135 | key.categories.mincamera=MineCamera 136 | key.minecamera.cameralock=Change Control Mode -------------------------------------------------------------------------------- /src/main/resources/assets/minecamera/lang/zh_CN.lang: -------------------------------------------------------------------------------- 1 | gui.camgameoverlay.unlocked=处理模式:脚架控制(CTRL) 2 | gui.camgameoverlay.locked=处理模式:玩家控制(CTRL) 3 | 4 | container.camera.text.outing=处理中 5 | container.camera.text.delay=延时 6 | 7 | text.info.FileNoFound=服务端图片不存在,照片无法读取。 8 | text.info.ErrorToLoadFile=服务端图片损坏,读取失败。 9 | text.info.ErrorToLoadLocalFile=本地图片缓存损坏,需要重启游戏加载 10 | 11 | container.picture_book.text.inputinfo=放入照片=>> 12 | container.picture_book.text.pictureindex=当前页: 13 | container.picture_book.text.totalpicturenum=总页: 14 | container.picture_book.text.owner=作者: 15 | container.picture_book.text.time=拍摄时间: 16 | container.picture_book.text.error=照片无信息 17 | 18 | container.photoprocessor.button.start=冲洗 19 | container.photoprocessor.text.success=冲洗完成,请取出照片! 20 | container.photoprocessor.text.default=放入材料,点击"冲洗"按钮开始~ 21 | container.photoprocessor.text.nonectl=恒温液不足,请添加! 22 | container.photoprocessor.text.noneda=显影液不足,请添加! 23 | container.photoprocessor.text.nonepaper=纸张不足,请添加! 24 | container.photoprocessor.text.nonefilm=请放入胶卷! 25 | container.photoprocessor.text.hasphotoout=已有冲洗完成的照片,请先取出! 26 | container.photoprocessor.text.outing=冲洗中...... 27 | container.photoprocessor.text.readsuccess=读取成功!胶卷作者: 28 | container.photoprocessor.text.lightleveltoohigh=光照强度过高,无法正常冲洗(需小于5) 29 | container.photoprocessor.text.lodingfilm=读取胶卷中.... 30 | container.photoprocessor.text.failed.FileNoFound=服务端图片不存在,无法冲洗 31 | container.photoprocessor.text.failed.ErrorToLoadFile=服务端图片损坏,无法冲洗 32 | container.photoprocessor.text.failed.ErrorToLoadLocalFile=本地图片缓存损坏,需要重启重新加载再冲洗 33 | container.photoprocessor.text.lightlevel=光照: 34 | 35 | chat.minecamera.isshooting=请勿快速重复操作 36 | chat.minecamera.delayinfo=将在 %1$s 秒后进行拍摄 37 | chat.minecamera.leavetripod=相机失去控制,拍摄结束 38 | chat.minecamera.trytoshoot=正在尝试拍摄 39 | 40 | chat.framemultiple.mustusehead=放置照片请右键相框最左下角 41 | chat.framemultiple.widthbuildtoomore=宽度太大,相框最大限制宽或高为:%1$s 42 | chat.framemultiple.heightbuildtoomore=高度太大,相框最大限制宽或高为:%1$s 43 | chat.framemultiple.failmultipleplace=多重搭建失败,所需空间不足(需要宽7高3空间),或者离其他相框过近(最小距离1格) 44 | chat.framemultiple.changeanddrowpicture=相框结构变化,照片已掉落,请自行捡起 45 | chat.framemultiple.widthorheighttoosmall=相框结构有误(长宽务必大于等于2) 46 | chat.framemultiple.failedtobuild=相框搭建结构有误,请检查(必须4边形) 47 | chat.framemultiple.removeuselesspart=相框多余部分已经被拆除 48 | 49 | itemGroup.minecamera=摄影工艺 50 | 51 | item.glasses_helmet.name=末影眼镜 52 | item.camera.name=胶卷照相机 53 | item.picture.name=照片 54 | item.battery.name=电池 55 | item.film.name=胶卷 56 | item.tripod.name=三脚架相机 57 | item.cnst_temp_liquid.name=恒温液 58 | item.developing_agent.name=显影液 59 | item.photo_paper.name=感光相纸 60 | item.picture_book.name=相册 61 | 62 | 63 | tile.pictureframe.name=小相框 64 | tile.photoprocessor.name=照片冲洗机 65 | tile.pictureframe_multiple.name=多重相框 66 | 67 | 68 | lore.pictureframe.info=可以摆放在方块上方或者墙上的小相框 69 | lore.pictureframe_multiple.info=可以拼接自定义大小的相框 70 | lore.pictureframe_multiple.info2=按住shift+右键可以快速放置3X2, 71 | lore.pictureframe_multiple.info3=同时shift+敲掉相框,可以快速敲落相框 72 | 73 | lore.glasses_helmet.info=戴上这眼睛可以与三脚架相机视觉交换 74 | lore.glasses_helmet.info2=~~~ 75 | 76 | lore.liquid.damage=剂量: 77 | lore.battery.damage=电量: 78 | 79 | lore.battery.info=一节更比六节强 80 | 81 | 82 | lore.picture.null=照片信息为空 83 | lore.picture.author=拍摄者: 84 | lore.picture.noauthor=照片非玩家拍摄 85 | lore.picture.time=拍摄时间: 86 | 87 | lore.film.author=作者: 88 | lore.film.time=拍摄时间: 89 | lore.film.info=胶卷状态: 90 | lore.film.info.used=已使用 91 | lore.film.info.unused=未使用 92 | 93 | lore.tripod.info=可以摆放在地上进行拍摄 94 | lore.tripod.info2=并且使用末影眼镜交换视野 95 | 96 | lore.picturebook.info=照片数量: 97 | 98 | chat.tripod.mustuseglass=你必须戴上末影眼镜才可以与三脚架相机交换视野 99 | chat.tripod.mustup=脚架必须放在地面上 100 | chat.tripod.info=按键CTRL切换控制模式,SHIFT(胶卷控制下)离开摄像头 101 | 102 | chat.minecamera.isouting=胶卷还未处理,请打开摄像机进行胶卷处理 103 | chat.minecamera.nofilm=请在相机内放入胶卷以拍摄! 104 | chat.minecamera.hasfilmout=相机内已处理胶卷还未取出,请取出! 105 | chat.minecamera.nobettery=请在相机内放入电池以拍摄! 106 | chat.minecamera.filmcantwrite=这个胶卷已被使用! 107 | chat.minecamera.betteryrunout=电池已用尽!请注意补充~ 108 | chat.minecamera.success=拍摄成功,请打开照相机进行处理~ 109 | 110 | chat.picturebook.tomany=相册照片数量过多,已无法添加 111 | 112 | achievement.minecamera.start=首次安装 113 | achievement.minecamera.start.desc=感谢安装摄影工艺模组! 114 | achievement.minecamera.craftcamera=怀旧摄影师 115 | achievement.minecamera.craftcamera.desc=在当今数码时代,使用胶卷摄像机真是件稀奇的事情! 116 | achievement.minecamera.craftprocessor=尝试旧技艺 117 | achievement.minecamera.craftprocessor.desc=胶卷冲洗照片,当今很少见了呢~ 118 | achievement.minecamera.craftfilm=胶卷!重温曾经 119 | achievement.minecamera.craftfilm.desc=请不要忘记了将要退出历史舞台的它 120 | achievement.minecamera.craftphoto_paper=感光纸技艺 121 | achievement.minecamera.craftphoto_paper.desc=大量使用打印技术的当今,不要忘了他的存在 122 | achievement.minecamera.craftpictureframe=回忆再现装置 123 | achievement.minecamera.craftpictureframe.desc=一张照片承载了太多东西,再现你的回忆是其中之一 124 | achievement.minecamera.craftpictureframe_multiple=照片墙 125 | achievement.minecamera.craftpictureframe_multiple.desc=让你的一面墙都成为你的回忆吧. 126 | achievement.minecamera.crafttripod=尝试脚架拍摄 127 | achievement.minecamera.crafttripod.desc=自我陶醉,或者与你的朋友合照吧 128 | achievement.minecamera.craftglasses=拍摄的魅力 129 | achievement.minecamera.craftglasses.desc=试试感受脚架拍摄的魅力吧 130 | achievement.minecamera.craftpicture_book=沉甸甸的书 131 | achievement.minecamera.craftpicture_book.desc=装着记忆的小册子 132 | achievement.minecamera.craftpicture=带有色彩的记忆 133 | achievement.minecamera.craftpicture.desc=好好保存好你的照片吧,最好准备个小册子? 134 | 135 | key.categories.mincamera=摄影工艺 136 | key.minecamera.cameralock=控制模式更改 137 | -------------------------------------------------------------------------------- /src/main/resources/assets/minecamera/models/block/photoprocessor.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "block/block", 3 | "__createdwith": "opl's Model Creator", 4 | "ambientocclusion": false, 5 | "textures": { 6 | "main": "minecamera:blocks/photoprocessor", 7 | "particle": "minecamera:blocks/photoprocessor" 8 | }, 9 | "elements": [ 10 | { 11 | "from": [0,0,0], 12 | "to": [16,16,16], 13 | "faces": { 14 | "up": { 15 | "uv": [0,8,8,16], 16 | "texture": "#main", 17 | "rotation": 180 18 | }, 19 | "down": { 20 | "uv": [0,0,8,8], 21 | "texture": "#main" 22 | }, 23 | "west": { 24 | "uv": [0,0,8,8], 25 | "texture": "#main" 26 | }, 27 | "east": { 28 | "uv": [0,0,8,8], 29 | "texture": "#main" 30 | }, 31 | "north": { 32 | "uv": [8,0,16,8], 33 | "texture": "#main" 34 | }, 35 | "south": { 36 | "uv": [0,0,8,8], 37 | "texture": "#main" 38 | } 39 | } 40 | } 41 | ] 42 | } -------------------------------------------------------------------------------- /src/main/resources/assets/minecamera/models/block/pictureframe.json: -------------------------------------------------------------------------------- 1 | { 2 | "__createdwith": "opl's Model Creator", 3 | "ambientocclusion": false, 4 | "textures": { 5 | "particle": "minecraft:blocks/planks_oak", 6 | "main": "minecamera:blocks/pictureframe", 7 | "planks": "minecraft:blocks/planks_oak" 8 | }, 9 | "elements": [ 10 | { 11 | "from": [0,2,15], 12 | "to": [16,14,16], 13 | "faces": { 14 | "up": { 15 | "texture": "#planks" 16 | }, 17 | "down": { 18 | "texture": "#planks" 19 | }, 20 | "west": { 21 | "texture": "#planks" 22 | }, 23 | "east": { 24 | "texture": "#planks" 25 | }, 26 | "north": { 27 | "uv": [0,2.25,16,13.75], 28 | "texture": "#main" 29 | }, 30 | "south": { 31 | "uv": [0,2,16,14], 32 | "texture": "#planks" 33 | } 34 | } 35 | } 36 | ] 37 | } -------------------------------------------------------------------------------- /src/main/resources/assets/minecamera/models/block/pictureframe_multiple_corner.json: -------------------------------------------------------------------------------- 1 | { 2 | "__createdwith": "opl's Model Creator", 3 | "ambientocclusion": false, 4 | "textures": { 5 | "particle": "minecraft:blocks/planks_oak", 6 | "main": "minecamera:blocks/pictureframe_multiple_corner", 7 | "planks": "blocks/planks_oak" 8 | }, 9 | "elements": [ 10 | { 11 | "from": [ 0, 0, 15 ], 12 | "to": [ 16, 16, 16 ], 13 | "faces": { 14 | "down": { "uv": [ 16, 16, 0, 15 ], "texture": "#planks" }, 15 | "up": { "uv": [ 0, 15, 16, 16 ], "texture": "#planks" }, 16 | "north": { "uv": [ 0, 0, 16, 16 ], "texture": "#main" }, 17 | "south": { "uv": [ 0, 0, 16, 16 ], "texture": "#planks" }, 18 | "west": { "uv": [ 15, 0, 16, 16 ], "texture": "#planks" }, 19 | "east": { "uv": [ 0, 0, 1, 16 ], "texture": "#planks" } 20 | } 21 | } 22 | ] 23 | } -------------------------------------------------------------------------------- /src/main/resources/assets/minecamera/models/block/pictureframe_multiple_corner_1.json: -------------------------------------------------------------------------------- 1 | { 2 | "__createdwith": "opl's Model Creator", 3 | "ambientocclusion": false, 4 | "textures": { 5 | "particle": "minecraft:blocks/planks_oak", 6 | "main": "minecamera:blocks/pictureframe_multiple_corner", 7 | "planks": "blocks/planks_oak" 8 | }, 9 | "elements": [ 10 | { 11 | "from": [ 0, 0, 15 ], 12 | "to": [ 16, 16, 16 ], 13 | "faces": { 14 | "down": { "uv": [ 16, 16, 0, 15 ], "texture": "#planks" }, 15 | "up": { "uv": [ 0, 15, 16, 16 ], "texture": "#planks" }, 16 | "north": { "uv": [ 0, 0, 16, 16 ], "texture": "#main" ,"rotation": 90}, 17 | "south": { "uv": [ 0, 0, 16, 16 ], "texture": "#planks" }, 18 | "west": { "uv": [ 15, 0, 16, 16 ], "texture": "#planks" }, 19 | "east": { "uv": [ 0, 0, 1, 16 ], "texture": "#planks" } 20 | } 21 | } 22 | ] 23 | } -------------------------------------------------------------------------------- /src/main/resources/assets/minecamera/models/block/pictureframe_multiple_edge.json: -------------------------------------------------------------------------------- 1 | { 2 | "__createdwith": "opl's Model Creator", 3 | "ambientocclusion": false, 4 | "textures": { 5 | "particle": "minecraft:blocks/planks_oak", 6 | "main": "minecamera:blocks/pictureframe_multiple_edge", 7 | "planks": "blocks/planks_oak" 8 | }, 9 | "elements": [ 10 | { 11 | "from": [ 0, 0, 15 ], 12 | "to": [ 16, 16, 16 ], 13 | "faces": { 14 | "down": { "uv": [ 16, 16, 0, 15 ], "texture": "#planks" }, 15 | "up": { "uv": [ 0, 15, 16, 16 ], "texture": "#planks" }, 16 | "north": { "uv": [ 0, 0, 16, 16 ], "texture": "#main" }, 17 | "south": { "uv": [ 0, 0, 16, 16 ], "texture": "#planks" }, 18 | "west": { "uv": [ 15, 0, 16, 16 ], "texture": "#planks" }, 19 | "east": { "uv": [ 0, 0, 1, 16 ], "texture": "#planks" } 20 | } 21 | } 22 | ] 23 | } -------------------------------------------------------------------------------- /src/main/resources/assets/minecamera/models/block/pictureframe_multiple_edge_1.json: -------------------------------------------------------------------------------- 1 | { 2 | "__createdwith": "opl's Model Creator", 3 | "ambientocclusion": false, 4 | "textures": { 5 | "particle": "minecraft:blocks/planks_oak", 6 | "main": "minecamera:blocks/pictureframe_multiple_edge", 7 | "planks": "blocks/planks_oak" 8 | }, 9 | "elements": [ 10 | { 11 | "from": [ 0, 0, 15 ], 12 | "to": [ 16, 16, 16 ], 13 | "faces": { 14 | "down": { "uv": [ 16, 16, 0, 15 ], "texture": "#planks" }, 15 | "up": { "uv": [ 0, 15, 16, 16 ], "texture": "#planks" }, 16 | "north": { "uv": [ 0, 0, 16, 16 ], "texture": "#main" ,"rotation": 90}, 17 | "south": { "uv": [ 0, 0, 16, 16 ], "texture": "#planks" }, 18 | "west": { "uv": [ 15, 0, 16, 16 ], "texture": "#planks" }, 19 | "east": { "uv": [ 0, 0, 1, 16 ], "texture": "#planks" } 20 | } 21 | } 22 | ] 23 | } -------------------------------------------------------------------------------- /src/main/resources/assets/minecamera/models/block/pictureframe_multiple_mid.json: -------------------------------------------------------------------------------- 1 | { 2 | "__createdwith": "opl's Model Creator", 3 | "ambientocclusion": false, 4 | "textures": { 5 | "particle": "minecraft:blocks/planks_oak", 6 | "main": "blocks/wool_colored_white", 7 | "planks": "blocks/planks_oak" 8 | }, 9 | "elements": [ 10 | { 11 | "from": [ 0, 0, 15 ], 12 | "to": [ 16, 16, 16 ], 13 | "faces": { 14 | "down": { "uv": [ 16, 16, 0, 15 ], "texture": "#planks" }, 15 | "up": { "uv": [ 0, 15, 16, 16 ], "texture": "#planks" }, 16 | "north": { "uv": [ 0, 0, 16, 16 ], "texture": "#main" }, 17 | "south": { "uv": [ 0, 0, 16, 16 ], "texture": "#planks" }, 18 | "west": { "uv": [ 15, 0, 16, 16 ], "texture": "#planks" }, 19 | "east": { "uv": [ 0, 0, 1, 16 ], "texture": "#planks" } 20 | } 21 | } 22 | ] 23 | } -------------------------------------------------------------------------------- /src/main/resources/assets/minecamera/models/block/pictureframestand.json: -------------------------------------------------------------------------------- 1 | { 2 | "__createdwith": "opl's Model Creator", 3 | "ambientocclusion": false, 4 | "textures": { 5 | "particle": "minecraft:blocks/planks_oak", 6 | "main": "minecamera:blocks/pictureframe", 7 | "planks": "minecraft:blocks/planks_oak" 8 | }, 9 | "elements": [ 10 | { 11 | "from": [ 0, -0.625, 10.5922 ], 12 | "to": [ 16, 11.375, 11.5922 ], 13 | "rotation": { "origin": [ 0, 11.375, 10.5922 ], "axis": "x", "angle": 22.5 }, 14 | "faces": { 15 | "down": { "uv": [ 16, 16, 0, 15 ], "texture": "#planks" }, 16 | "up": { "uv": [ 0, 15, 16, 16 ], "texture": "#planks" }, 17 | "north": { "uv": [ 0, 2.3125, 16, 13.8125 ], "texture": "#main" }, 18 | "south": { "uv": [ 0, 2, 16, 14 ], "texture": "#planks" }, 19 | "west": { "uv": [ 15, 2, 16, 14 ], "texture": "#planks" }, 20 | "east": { "uv": [ 0, 2, 1, 14 ], "texture": "#planks" } 21 | } 22 | }, 23 | { 24 | "from": [ 4, -0.4375, 8.25 ], 25 | "to": [ 5, 4.75, 9.3125 ], 26 | "rotation": { "origin": [ 4, 4.75, 8.25 ], "axis": "x", "angle": -22.5 }, 27 | "faces": { 28 | "down": { "uv": [ 0, 14.9375, 1, 16 ], "texture": "#planks" }, 29 | "up": { "uv": [ 0.0625, 14.875, 1.0625, 15.9375 ], "texture": "#planks" }, 30 | "north": { "uv": [ 0, 10.75, 1, 15.9375 ], "texture": "#planks" }, 31 | "south": { "uv": [ 0, 10.75, 1, 15.9375 ], "texture": "#planks" }, 32 | "west": { "uv": [ 0, 10.8125, 1.0625, 16 ], "texture": "#planks" }, 33 | "east": { "uv": [ 0, 10.8125, 1.0625, 16 ], "texture": "#planks" } 34 | } 35 | }, 36 | { 37 | "from": [ 11, -0.531601, 8.25 ], 38 | "to": [ 12, 4.6559, 9.3125 ], 39 | "rotation": { "origin": [ 11, 4.6559, 8.25 ], "axis": "x", "angle": -22.5 }, 40 | "faces": { 41 | "down": { "uv": [ 0, 14.9375, 1, 16 ], "texture": "#planks" }, 42 | "up": { "uv": [ 0.0625, 14.875, 1.0625, 15.9375 ], "texture": "#planks" }, 43 | "north": { "uv": [ 0, 10.75, 1, 15.9375 ], "texture": "#planks" }, 44 | "south": { "uv": [ 0, 10.75, 1, 15.9375 ], "texture": "#planks" }, 45 | "west": { "uv": [ 0, 10.8125, 1.0625, 16 ], "texture": "#planks" }, 46 | "east": { "uv": [ 0, 10.8125, 1.0625, 16 ], "texture": "#planks" } 47 | } 48 | } 49 | ] 50 | } -------------------------------------------------------------------------------- /src/main/resources/assets/minecamera/models/item/battery.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "item/generated", 3 | "textures": { 4 | "layer0": "minecamera:items/battery" 5 | } 6 | } -------------------------------------------------------------------------------- /src/main/resources/assets/minecamera/models/item/camera.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "block/cube_all", 3 | "__createdwith": "opl's Model Creator ", 4 | "ambientocclusion": false, 5 | "textures": { 6 | "top": "minecamera:items/camera" 7 | }, 8 | "display": { 9 | "gui": { 10 | "rotation": [ 90, 0, 0 ], 11 | "translation": [ 0, 0, 0], 12 | "scale":[ 0.85 ,0.85, 0.85] 13 | }, 14 | "ground": { 15 | "rotation": [ 0, 0, 0 ], 16 | "translation": [ 0, 2, 0], 17 | "scale":[ 0.5, 0.5, 0.5 ] 18 | }, 19 | "head": { 20 | "rotation": [ 0, 180, 0 ], 21 | "translation": [ 0, 13, 7], 22 | "scale":[ 1, 1, 1] 23 | }, 24 | "thirdperson_righthand": { 25 | "rotation": [ 270, -180, 0 ], 26 | "translation": [ 0, 1.5, -2 ], 27 | "scale": [ 0.55, 0.55, 0.55 ] 28 | }, 29 | "firstperson_righthand": { 30 | "rotation": [ 90, 0, 195 ], 31 | "translation": [ 0.0, 3.0, -4.0], 32 | "scale": [ 0.5, 0.5, 0.5 ] 33 | } 34 | }, 35 | "elements": [ 36 | { 37 | "from": [0,0,3], 38 | "to": [16,3,13], 39 | "faces": { 40 | "up": { 41 | "uv": [0,0,6.375,3.875], 42 | "texture": "#top", 43 | "tintindex": 8 44 | }, 45 | "down": { 46 | "uv": [7,0,13.375,3.875], 47 | "texture": "#top" 48 | }, 49 | "west": { 50 | "uv": [7,0,8,3.875], 51 | "texture": "#top" 52 | }, 53 | "east": { 54 | "uv": [7,0,8,3.875], 55 | "texture": "#top" 56 | }, 57 | "north": { 58 | "uv": [7,0,13.25,1.25], 59 | "texture": "#top" 60 | }, 61 | "south": { 62 | "uv": [7.375,2.75,13.375,3.875], 63 | "texture": "#top" 64 | } 65 | } 66 | }, 67 | { 68 | "from": [2,0,2], 69 | "to": [5,3,3], 70 | "faces": { 71 | "up": { 72 | "uv": [4,2.625,5.125,3.125], 73 | "texture": "#top" 74 | }, 75 | "down": { 76 | "uv": [7.875,0.625,10.875,1.625], 77 | "texture": "#top" 78 | }, 79 | "west": { 80 | "uv": [8.25,0.375,9.25,3.375], 81 | "texture": "#top" 82 | }, 83 | "east": { 84 | "uv": [8.5,0.5,9.5,3.5], 85 | "texture": "#top" 86 | }, 87 | "north": { 88 | "uv": [7.25,0.625,10.25,3.625], 89 | "texture": "#top" 90 | } 91 | } 92 | } 93 | ] 94 | } -------------------------------------------------------------------------------- /src/main/resources/assets/minecamera/models/item/cnts_temp_liquid.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "item/generated", 3 | "textures": { 4 | "layer0": "minecamera:items/cnst_temp_liquid" 5 | } 6 | } -------------------------------------------------------------------------------- /src/main/resources/assets/minecamera/models/item/developing_agent.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "item/generated", 3 | "textures": { 4 | "layer0": "minecamera:items/developing_agent" 5 | } 6 | } -------------------------------------------------------------------------------- /src/main/resources/assets/minecamera/models/item/film.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "item/generated", 3 | "textures": { 4 | "layer0": "minecamera:items/film" 5 | } 6 | } -------------------------------------------------------------------------------- /src/main/resources/assets/minecamera/models/item/glasses_helmet.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "item/generated", 3 | "textures": { 4 | "layer0": "minecamera:items/glasses_helmet" 5 | } 6 | } -------------------------------------------------------------------------------- /src/main/resources/assets/minecamera/models/item/photo_paper.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "item/generated", 3 | "textures": { 4 | "layer0": "minecamera:items/photo_paper" 5 | } 6 | } -------------------------------------------------------------------------------- /src/main/resources/assets/minecamera/models/item/photoprocessor.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "minecamera:block/photoprocessor", 3 | "display": { 4 | "thirdperson": { 5 | "rotation": [ 10, -45, 170 ], 6 | "translation": [ 0, 1.5, -2.75 ], 7 | "scale": [ 0.375, 0.375, 0.375 ] 8 | } 9 | } 10 | } -------------------------------------------------------------------------------- /src/main/resources/assets/minecamera/models/item/picture.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "item/generated", 3 | "textures": { 4 | "layer0": "minecamera:items/picture" 5 | } 6 | } -------------------------------------------------------------------------------- /src/main/resources/assets/minecamera/models/item/picture_book.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "item/generated", 3 | "textures": { 4 | "layer0": "minecamera:items/picture_book" 5 | } 6 | } -------------------------------------------------------------------------------- /src/main/resources/assets/minecamera/models/item/pictureframe.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "item/generated", 3 | "textures": { 4 | "layer0": "minecamera:blocks/pictureframe" 5 | } 6 | } -------------------------------------------------------------------------------- /src/main/resources/assets/minecamera/models/item/pictureframe_multiple.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "item/generated", 3 | "textures": { 4 | "layer0": "minecamera:items/pictureframe_multiple" 5 | } 6 | } -------------------------------------------------------------------------------- /src/main/resources/assets/minecamera/models/item/tripod.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "item/generated", 3 | "textures": { 4 | "layer0": "minecamera:items/tripod" 5 | } 6 | } -------------------------------------------------------------------------------- /src/main/resources/assets/minecamera/recipes/itemBattery.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "forge:ore_shaped", 3 | "pattern": [ 4 | "!#!", 5 | "!@!", 6 | "!@!" 7 | ], 8 | "key": { 9 | "!": { 10 | "item": "minecraft:redstone_block" 11 | }, 12 | "@": { 13 | "item": "minecraft:obsidian" 14 | }, 15 | "#": { 16 | "item": "minecraft:stone_button" 17 | } 18 | }, 19 | "result": { 20 | "item": "minecamera:battery" 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/main/resources/assets/minecamera/recipes/itemCamera.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "forge:ore_shaped", 3 | "pattern": [ 4 | "!@#", 5 | "$%@", 6 | "@@@" 7 | ], 8 | "key": { 9 | "@": { 10 | "item": "minecraft:grass" 11 | }, 12 | "!": { 13 | "item": "minecraft:glowstone" 14 | }, 15 | "#": { 16 | "item": "minecraft:stone_button" 17 | }, 18 | "$": { 19 | "item": "minecraft:ender_eye" 20 | }, 21 | "%": { 22 | "item": "minecraft:redstone_block" 23 | } 24 | }, 25 | "result": { 26 | "item": "minecamera:camera" 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/main/resources/assets/minecamera/recipes/itemCamera_2.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "forge:ore_shapeless", 3 | "ingredients": [ 4 | { 5 | "item": "minecamera:tripod" 6 | } 7 | ], 8 | "result": { 9 | "item": "minecamera:camera" 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/main/resources/assets/minecamera/recipes/itemCntsTempLiquid.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "forge:ore_shaped", 3 | "pattern": [ 4 | "!!!", 5 | "@!@", 6 | "@#@" 7 | ], 8 | "key": { 9 | "!": { 10 | "item": "minecraft:blaze_rod" 11 | }, 12 | "@": { 13 | "item": "minecraft:glass_pane" 14 | }, 15 | "#": { 16 | "item": "minecraft:water_bucket" 17 | } 18 | }, 19 | "result": { 20 | "item": "minecamera:cnts_temp_liquid" 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/main/resources/assets/minecamera/recipes/itemDevelopingAgent.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "forge:ore_shaped", 3 | "pattern": [ 4 | "!@#", 5 | "$%$", 6 | "^&^" 7 | ], 8 | "key": { 9 | "!": { 10 | "item": "minecraft:dye", 11 | "data": 1 12 | }, 13 | "@": { 14 | "item": "minecraft:dye", 15 | "data": 11 16 | }, 17 | "#": { 18 | "item": "minecraft:dye", 19 | "data": 4 20 | }, 21 | "$": { 22 | "item": "minecraft:gold_ingot" 23 | }, 24 | "%": { 25 | "item": "minecraft:ender_pearl" 26 | }, 27 | "^": { 28 | "item": "minecraft:glass_pane" 29 | }, 30 | "&": { 31 | "item": "minecraft:water_bucket" 32 | } 33 | }, 34 | "result": { 35 | "item": "minecamera:developing_agent" 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/main/resources/assets/minecamera/recipes/itemFilm.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "forge:ore_shaped", 3 | "pattern": [ 4 | "!!!", 5 | "@@@", 6 | "!!!" 7 | ], 8 | "key": { 9 | "!": { 10 | "item": "minecraft:ender_pearl" 11 | }, 12 | "@": { 13 | "item": "minecraft:glass_pane" 14 | } 15 | }, 16 | "result": { 17 | "item": "minecamera:film" 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/main/resources/assets/minecamera/recipes/itemGlassesHelmet.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "forge:ore_shaped", 3 | "pattern": [ 4 | "!%!", "@#@","! !" 5 | ], 6 | "key": { 7 | "!": { 8 | "item": "minecraft:stick" 9 | }, 10 | "@": { 11 | "item": "minecraft:glass_pane" 12 | }, 13 | "#": { 14 | "item": "minecraft:obsidian" 15 | }, 16 | "%": { 17 | "item": "minecraft:ender_eye" 18 | } 19 | }, 20 | "result": { 21 | "item": "minecamera:glasses_helmet" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/main/resources/assets/minecamera/recipes/itemPhotoPaper.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "forge:ore_shapeless", 3 | "ingredients": [ 4 | { 5 | "item": "minecraft:milk_bucket" 6 | }, 7 | { 8 | "item": "minecraft:paper" 9 | }, 10 | { 11 | "item": "minecraft:iron_ingot" 12 | }, 13 | { 14 | "item": "minecraft:gold_ingot" 15 | } 16 | ], 17 | "result": { 18 | "item": "minecamera:photo_paper" 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/main/resources/assets/minecamera/recipes/itemPictureBook.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "forge:ore_shaped", 3 | "pattern": [ 4 | "!!!", "!@#","!##" 5 | ], 6 | "key": { 7 | "!": { 8 | "item": "minecraft:paper" 9 | }, 10 | "@": { 11 | "item": "minecraft:slime_ball" 12 | }, 13 | "#": { 14 | "item": "minecraft:leather" 15 | } 16 | }, 17 | "result": { 18 | "item": "minecamera:picture_book" 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/main/resources/assets/minecamera/recipes/itemTripod.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "forge:ore_shaped", 3 | "pattern": [ 4 | " ! ", 5 | " @ ", 6 | "@#@" 7 | ], 8 | "key": { 9 | "!": { 10 | "item": "minecamera:camera" 11 | }, 12 | "@": { 13 | "item": "minecraft:iron_block" 14 | }, 15 | "#": { 16 | "item": "minecraft:ender_eye" 17 | } 18 | }, 19 | "result": { 20 | "item": "minecamera:tripod" 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/main/resources/assets/minecamera/recipes/photoprocessor.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "forge:ore_shaped", 3 | "pattern": [ 4 | "!@!", 5 | "!#!", 6 | "!$!" 7 | ], 8 | "key": { 9 | "!": { 10 | "item": "minecraft:iron_block" 11 | }, 12 | "@": { 13 | "item": "minecraft:diamond" 14 | }, 15 | "#": { 16 | "item": "minecraft:ender_pearl" 17 | }, 18 | "$": { 19 | "item": "minecraft:redstone_block" 20 | } 21 | }, 22 | "result": { 23 | "item": "minecamera:photoprocessor" 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/main/resources/assets/minecamera/recipes/pictureFrame.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "forge:ore_shaped", 3 | "pattern": [ 4 | "!!", 5 | "@@" 6 | ], 7 | "key": { 8 | "!": { 9 | "type": "forge:ore_dict", 10 | "ore": "plankWood" 11 | }, 12 | "@": { 13 | "item": "minecraft:wool", 14 | "data": 0 15 | } 16 | }, 17 | "result": { 18 | "item": "minecamera:pictureframe" 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/main/resources/assets/minecamera/recipes/pictureFrameMultiple.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "forge:ore_shaped", 3 | "pattern": [ 4 | "!!!", 5 | "@@@", 6 | "@@@" 7 | ], 8 | "key": { 9 | "!": { 10 | "type": "forge:ore_dict", 11 | "ore": "plankWood" 12 | }, 13 | "@": { 14 | "item": "minecraft:wool", 15 | "data": 0 16 | } 17 | }, 18 | "result": { 19 | "item": "minecamera:pictureframe_multiple" 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/main/resources/assets/minecamera/sounds.json: -------------------------------------------------------------------------------- 1 | { 2 | "minecamera.kacha": { 3 | "category": "player", 4 | "sounds": [ 5 | "minecamera:kacha" 6 | ] 7 | }, 8 | "minecamera.book": { 9 | "category": "player", 10 | "sounds": [ 11 | "minecamera:book" 12 | ] 13 | }, 14 | "minecamera.output": { 15 | "category": "player", 16 | "sounds": [ 17 | "minecamera:output" 18 | ] 19 | } 20 | } -------------------------------------------------------------------------------- /src/main/resources/assets/minecamera/sounds/book.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PorPit/MineCamera/d52eb883f2af9a8f66cf183060898c7672c9a471/src/main/resources/assets/minecamera/sounds/book.ogg -------------------------------------------------------------------------------- /src/main/resources/assets/minecamera/sounds/kacha.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PorPit/MineCamera/d52eb883f2af9a8f66cf183060898c7672c9a471/src/main/resources/assets/minecamera/sounds/kacha.ogg -------------------------------------------------------------------------------- /src/main/resources/assets/minecamera/sounds/output.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PorPit/MineCamera/d52eb883f2af9a8f66cf183060898c7672c9a471/src/main/resources/assets/minecamera/sounds/output.ogg -------------------------------------------------------------------------------- /src/main/resources/assets/minecamera/textures/blocks/grass_block.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PorPit/MineCamera/d52eb883f2af9a8f66cf183060898c7672c9a471/src/main/resources/assets/minecamera/textures/blocks/grass_block.png -------------------------------------------------------------------------------- /src/main/resources/assets/minecamera/textures/blocks/photoprocessor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PorPit/MineCamera/d52eb883f2af9a8f66cf183060898c7672c9a471/src/main/resources/assets/minecamera/textures/blocks/photoprocessor.png -------------------------------------------------------------------------------- /src/main/resources/assets/minecamera/textures/blocks/pictureframe.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PorPit/MineCamera/d52eb883f2af9a8f66cf183060898c7672c9a471/src/main/resources/assets/minecamera/textures/blocks/pictureframe.png -------------------------------------------------------------------------------- /src/main/resources/assets/minecamera/textures/blocks/pictureframe_multiple_corner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PorPit/MineCamera/d52eb883f2af9a8f66cf183060898c7672c9a471/src/main/resources/assets/minecamera/textures/blocks/pictureframe_multiple_corner.png -------------------------------------------------------------------------------- /src/main/resources/assets/minecamera/textures/blocks/pictureframe_multiple_edge.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PorPit/MineCamera/d52eb883f2af9a8f66cf183060898c7672c9a471/src/main/resources/assets/minecamera/textures/blocks/pictureframe_multiple_edge.png -------------------------------------------------------------------------------- /src/main/resources/assets/minecamera/textures/entity/tripod.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PorPit/MineCamera/d52eb883f2af9a8f66cf183060898c7672c9a471/src/main/resources/assets/minecamera/textures/entity/tripod.png -------------------------------------------------------------------------------- /src/main/resources/assets/minecamera/textures/gui/container/gui_camera.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PorPit/MineCamera/d52eb883f2af9a8f66cf183060898c7672c9a471/src/main/resources/assets/minecamera/textures/gui/container/gui_camera.png -------------------------------------------------------------------------------- /src/main/resources/assets/minecamera/textures/gui/container/gui_photoprocessor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PorPit/MineCamera/d52eb883f2af9a8f66cf183060898c7672c9a471/src/main/resources/assets/minecamera/textures/gui/container/gui_photoprocessor.png -------------------------------------------------------------------------------- /src/main/resources/assets/minecamera/textures/gui/container/gui_picture_book.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PorPit/MineCamera/d52eb883f2af9a8f66cf183060898c7672c9a471/src/main/resources/assets/minecamera/textures/gui/container/gui_picture_book.png -------------------------------------------------------------------------------- /src/main/resources/assets/minecamera/textures/gui/image/advancement_bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PorPit/MineCamera/d52eb883f2af9a8f66cf183060898c7672c9a471/src/main/resources/assets/minecamera/textures/gui/image/advancement_bg.png -------------------------------------------------------------------------------- /src/main/resources/assets/minecamera/textures/gui/image/cameragui.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PorPit/MineCamera/d52eb883f2af9a8f66cf183060898c7672c9a471/src/main/resources/assets/minecamera/textures/gui/image/cameragui.png -------------------------------------------------------------------------------- /src/main/resources/assets/minecamera/textures/gui/image/donate.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PorPit/MineCamera/d52eb883f2af9a8f66cf183060898c7672c9a471/src/main/resources/assets/minecamera/textures/gui/image/donate.png -------------------------------------------------------------------------------- /src/main/resources/assets/minecamera/textures/gui/image/failtoload.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PorPit/MineCamera/d52eb883f2af9a8f66cf183060898c7672c9a471/src/main/resources/assets/minecamera/textures/gui/image/failtoload.png -------------------------------------------------------------------------------- /src/main/resources/assets/minecamera/textures/gui/image/loding.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PorPit/MineCamera/d52eb883f2af9a8f66cf183060898c7672c9a471/src/main/resources/assets/minecamera/textures/gui/image/loding.png -------------------------------------------------------------------------------- /src/main/resources/assets/minecamera/textures/items/battery.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PorPit/MineCamera/d52eb883f2af9a8f66cf183060898c7672c9a471/src/main/resources/assets/minecamera/textures/items/battery.png -------------------------------------------------------------------------------- /src/main/resources/assets/minecamera/textures/items/camera.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PorPit/MineCamera/d52eb883f2af9a8f66cf183060898c7672c9a471/src/main/resources/assets/minecamera/textures/items/camera.png -------------------------------------------------------------------------------- /src/main/resources/assets/minecamera/textures/items/cnst_temp_liquid.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PorPit/MineCamera/d52eb883f2af9a8f66cf183060898c7672c9a471/src/main/resources/assets/minecamera/textures/items/cnst_temp_liquid.png -------------------------------------------------------------------------------- /src/main/resources/assets/minecamera/textures/items/developing_agent.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PorPit/MineCamera/d52eb883f2af9a8f66cf183060898c7672c9a471/src/main/resources/assets/minecamera/textures/items/developing_agent.png -------------------------------------------------------------------------------- /src/main/resources/assets/minecamera/textures/items/film.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PorPit/MineCamera/d52eb883f2af9a8f66cf183060898c7672c9a471/src/main/resources/assets/minecamera/textures/items/film.png -------------------------------------------------------------------------------- /src/main/resources/assets/minecamera/textures/items/glasses_helmet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PorPit/MineCamera/d52eb883f2af9a8f66cf183060898c7672c9a471/src/main/resources/assets/minecamera/textures/items/glasses_helmet.png -------------------------------------------------------------------------------- /src/main/resources/assets/minecamera/textures/items/photo_paper.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PorPit/MineCamera/d52eb883f2af9a8f66cf183060898c7672c9a471/src/main/resources/assets/minecamera/textures/items/photo_paper.png -------------------------------------------------------------------------------- /src/main/resources/assets/minecamera/textures/items/picture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PorPit/MineCamera/d52eb883f2af9a8f66cf183060898c7672c9a471/src/main/resources/assets/minecamera/textures/items/picture.png -------------------------------------------------------------------------------- /src/main/resources/assets/minecamera/textures/items/picture_book.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PorPit/MineCamera/d52eb883f2af9a8f66cf183060898c7672c9a471/src/main/resources/assets/minecamera/textures/items/picture_book.png -------------------------------------------------------------------------------- /src/main/resources/assets/minecamera/textures/items/pictureframe_multiple.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PorPit/MineCamera/d52eb883f2af9a8f66cf183060898c7672c9a471/src/main/resources/assets/minecamera/textures/items/pictureframe_multiple.png -------------------------------------------------------------------------------- /src/main/resources/assets/minecamera/textures/items/tripod.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PorPit/MineCamera/d52eb883f2af9a8f66cf183060898c7672c9a471/src/main/resources/assets/minecamera/textures/items/tripod.png -------------------------------------------------------------------------------- /src/main/resources/assets/minecamera/textures/models/armor/glasses_layer_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PorPit/MineCamera/d52eb883f2af9a8f66cf183060898c7672c9a471/src/main/resources/assets/minecamera/textures/models/armor/glasses_layer_1.png -------------------------------------------------------------------------------- /src/main/resources/assets/minecraft/textures/gui/container/creative_inventory/tab_minecamera.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PorPit/MineCamera/d52eb883f2af9a8f66cf183060898c7672c9a471/src/main/resources/assets/minecraft/textures/gui/container/creative_inventory/tab_minecamera.png -------------------------------------------------------------------------------- /src/main/resources/mcmod.info: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "modid": "minecamera", 4 | "name": "MineCamera", 5 | "description": "A MineCraft CameraMOD", 6 | "version": "${version}", 7 | "mcversion": "${mcversion}", 8 | "url": "", 9 | "updateUrl": "", 10 | "authorList": [""], 11 | "credits": "", 12 | "logoFile": "", 13 | "screenshots": [], 14 | "dependencies": [] 15 | } 16 | ] 17 | -------------------------------------------------------------------------------- /src/rebel.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | --------------------------------------------------------------------------------