├── main
├── resources
│ ├── Contributors.txt
│ ├── assets
│ │ ├── dcs_climate
│ │ │ ├── models
│ │ │ │ ├── item
│ │ │ │ │ ├── dcs_cube_tb.json
│ │ │ │ │ ├── dcs_cube_sided.json
│ │ │ │ │ ├── dcs_slab_under_base.json
│ │ │ │ │ ├── dcs_slab_upper_base.json
│ │ │ │ │ ├── dcs_stairs_glass.json
│ │ │ │ │ ├── dcs_stairs_gypsum.json
│ │ │ │ │ ├── tool
│ │ │ │ │ │ ├── checker0.json
│ │ │ │ │ │ └── checker1.json
│ │ │ │ │ └── basetile.json
│ │ │ │ └── block
│ │ │ │ │ ├── basetile.json
│ │ │ │ │ ├── dcs_cube_3face.json
│ │ │ │ │ ├── dcs_cube_all.json
│ │ │ │ │ ├── dcs_0.json
│ │ │ │ │ ├── dcs_cube.json
│ │ │ │ │ ├── dcs_cube_tb.json
│ │ │ │ │ ├── dcs_slab_under_base.json
│ │ │ │ │ ├── dcs_slab_upper_base.json
│ │ │ │ │ ├── dcs_cube_sided.json
│ │ │ │ │ ├── dcs_cross.json
│ │ │ │ │ ├── dcs_ore.json
│ │ │ │ │ └── dcs_cube_lamp.json
│ │ │ ├── blockstates
│ │ │ │ ├── basetile.json
│ │ │ │ ├── dcs_cross.json
│ │ │ │ ├── dcs_cube_tb.json
│ │ │ │ ├── dcs_cube_sided.json
│ │ │ │ ├── dcs_slab_under_base.json
│ │ │ │ ├── dcs_slab_upper_base.json
│ │ │ │ └── dcs_slab_base.json
│ │ │ ├── recipes
│ │ │ │ ├── _factories.json
│ │ │ │ └── core
│ │ │ │ │ ├── dcs_bread_0.json
│ │ │ │ │ ├── dcs_flint_and_steel_0.json
│ │ │ │ │ ├── dcs_cookie_0.json
│ │ │ │ │ ├── dcs_bed_0.json
│ │ │ │ │ ├── dcs_compass_0.json
│ │ │ │ │ ├── dcs_painting_0.json
│ │ │ │ │ ├── dcs_saddle_0.json
│ │ │ │ │ ├── dcs_cake_0.json
│ │ │ │ │ └── dcs_gunpowder_0.json
│ │ │ └── textures
│ │ │ │ ├── gui
│ │ │ │ ├── hud_hot.png
│ │ │ │ ├── gui_icons.png
│ │ │ │ ├── hud_cold.png
│ │ │ │ ├── icon_base.png
│ │ │ │ ├── icon_boil.png
│ │ │ │ ├── icon_cold.png
│ │ │ │ ├── icon_cool.png
│ │ │ │ ├── icon_hot.png
│ │ │ │ ├── icon_kiln.png
│ │ │ │ ├── icon_oven.png
│ │ │ │ ├── icon_uht.png
│ │ │ │ ├── icon_warm.png
│ │ │ │ ├── c_biome_gui.png
│ │ │ │ ├── c_fluid_gui.png
│ │ │ │ ├── hud_climate.png
│ │ │ │ ├── icon_inferno.png
│ │ │ │ ├── icon_normal.png
│ │ │ │ ├── icons_potion.png
│ │ │ │ ├── info_gui_jei.png
│ │ │ │ ├── c_crafting_gui.png
│ │ │ │ ├── c_crops_gui_jei.png
│ │ │ │ ├── c_effective_gui.png
│ │ │ │ ├── c_mill_gui_jei.png
│ │ │ │ ├── c_smelting_gui.png
│ │ │ │ ├── hud_climate_adv.png
│ │ │ │ ├── icon_absolute.png
│ │ │ │ ├── icon_cryogenic.png
│ │ │ │ ├── icon_frostbite.png
│ │ │ │ ├── icon_smelting.png
│ │ │ │ ├── icons_potion_2.png
│ │ │ │ ├── c_crusher_gui_jei.png
│ │ │ │ ├── c_reactor_gui_jei.png
│ │ │ │ ├── chamber_fluid_gui.png
│ │ │ │ ├── chamber_main_gui.png
│ │ │ │ ├── fuellist_gui_jei.png
│ │ │ │ ├── hud_climate_rain.png
│ │ │ │ ├── c_crafting_gui_jei.png
│ │ │ │ ├── c_fluidcraft_gui_jei.png
│ │ │ │ ├── c_smelting_gui_jei.png
│ │ │ │ ├── chamber.normal.gui.png
│ │ │ │ ├── fluidprocessor_gui.png
│ │ │ │ ├── hud_climate_drought.png
│ │ │ │ ├── hud_climate_normal.png
│ │ │ │ └── hud_climate_thermometer.png
│ │ │ │ ├── blocks
│ │ │ │ ├── clear.png
│ │ │ │ ├── crop
│ │ │ │ │ └── shrub_1.png
│ │ │ │ ├── gray_effect.png
│ │ │ │ ├── cont
│ │ │ │ │ ├── woodbox_b.png
│ │ │ │ │ ├── woodbox_s.png
│ │ │ │ │ └── woodbox_t.png
│ │ │ │ └── destroy_effect.png
│ │ │ │ ├── items
│ │ │ │ ├── food
│ │ │ │ │ ├── flour.png
│ │ │ │ │ ├── roundbread_raw.png
│ │ │ │ │ └── roundbread_baked.png
│ │ │ │ ├── tool
│ │ │ │ │ └── checker.png
│ │ │ │ └── block
│ │ │ │ │ └── stovefuel_item.png
│ │ │ │ ├── tiles
│ │ │ │ └── stove_fuel.png
│ │ │ │ └── entity
│ │ │ │ └── food
│ │ │ │ ├── round_bread_baked.png
│ │ │ │ └── round_bread_raw.png
│ │ └── dcs_lib
│ │ │ └── lang
│ │ │ ├── Lang_File_Contributers.txt
│ │ │ ├── zh_tw.lang
│ │ │ ├── zh_cn.lang
│ │ │ ├── ja_jp.lang
│ │ │ └── ru_ru.lang
│ ├── META-INF
│ │ ├── haclib_at.cfg
│ │ └── MANIFEST.MF
│ ├── pack.mcmeta
│ ├── ReadMe_Plugin.txt
│ ├── mcmod.info
│ └── License.txt
└── java
│ └── defeatedcrow
│ └── hac
│ ├── api
│ ├── energy
│ │ ├── IWrenchDC.java
│ │ ├── ICrankReceiver.java
│ │ ├── ICrankDC.java
│ │ ├── ITorqueReceiver.java
│ │ ├── capability
│ │ │ ├── package-info.java
│ │ │ ├── ITorqueHandler.java
│ │ │ └── TorqueCapabilityHandler.java
│ │ ├── package-info.java
│ │ ├── ITorqueProvider.java
│ │ └── ITorqueDC.java
│ ├── recipe
│ │ ├── IRecipePanel.java
│ │ ├── IRecipeCatalyst.java
│ │ ├── package-info.java
│ │ ├── RecipeAPI.java
│ │ ├── ISpinningRecipe.java
│ │ ├── ISpinningRecipeRegister.java
│ │ ├── IMillRecipe.java
│ │ ├── IClimateObject.java
│ │ ├── IMillRecipeRegister.java
│ │ ├── ICrusherRecipe.java
│ │ └── ICrusherRecipeRegister.java
│ ├── item
│ │ ├── ICutleryItem.java
│ │ ├── IAnimalFood.java
│ │ ├── package-info.java
│ │ ├── IAnvilTool.java
│ │ └── IPlatingTool.java
│ ├── magic
│ │ ├── MagicType.java
│ │ ├── IJewel.java
│ │ ├── CharmType.java
│ │ ├── package-info.java
│ │ ├── IMagicCost.java
│ │ └── MagicColor.java
│ ├── climate
│ │ ├── IClimateIgnoreBlock.java
│ │ ├── IHeatCanceler.java
│ │ ├── IAirflowTile.java
│ │ ├── IHeatTile.java
│ │ ├── IHumidityTile.java
│ │ ├── ClimateAPI.java
│ │ ├── IClimate.java
│ │ ├── IThermalInsulationBlock.java
│ │ ├── IClimateTileEntity.java
│ │ ├── IClimateHelper.java
│ │ ├── package-info.java
│ │ ├── ClimateSupplier.java
│ │ ├── EnumSeason.java
│ │ ├── IHeatBlockRegister.java
│ │ ├── ClimateCalculateEvent.java
│ │ ├── ItemSet.java
│ │ ├── WorldHeatTierEvent.java
│ │ ├── BlockHeatTierEvent.java
│ │ └── BlockSet.java
│ ├── placeable
│ │ ├── IItemDropEntity.java
│ │ ├── ISidedTexture.java
│ │ ├── package-info.java
│ │ ├── IEntityItem.java
│ │ └── IRapidCollectables.java
│ ├── cultivate
│ │ ├── CropAPI.java
│ │ ├── IClimateCropRegister.java
│ │ ├── package-info.java
│ │ ├── GrowingStage.java
│ │ └── IClimateCrop.java
│ ├── damage
│ │ ├── DamageAPI.java
│ │ ├── package-info.java
│ │ ├── IArmorItemRegister.java
│ │ ├── IArmorMaterialRegister.java
│ │ ├── CamouflageInsideMaterialEvent.java
│ │ └── ClimateDamageEvent.java
│ ├── package-info.java
│ ├── hook
│ │ ├── package-info.java
│ │ ├── DCElytraFlyingEvent.java
│ │ ├── DCEntityItemUpdateEvent.java
│ │ ├── DCBlockFreezeEvent.java
│ │ ├── DCCaveOceanBlock.java
│ │ ├── DCBlockUpdateEvent.java
│ │ ├── DCBlockCollidedEvent.java
│ │ ├── DCBiomeTempEvent.java
│ │ ├── DCItemEatEvent.java
│ │ ├── DCItemDisplayNameEvent.java
│ │ ├── DCRavineWaterEvent.java
│ │ └── DCCaveWaterEvent.java
│ ├── module
│ │ ├── package-info.java
│ │ └── HaCModule.java
│ └── blockstate
│ │ └── package-info.java
│ ├── core
│ ├── client
│ │ ├── event
│ │ │ ├── ViewerMode.java
│ │ │ ├── IClimateViewer.java
│ │ │ └── WaterFogEvent.java
│ │ ├── DCTextures.java
│ │ └── base
│ │ │ ├── DCFoodModelBase.java
│ │ │ ├── DCTileModelBase.java
│ │ │ └── ContainerBaseDC.java
│ ├── base
│ │ ├── INameSuffix.java
│ │ ├── EnumStateType.java
│ │ ├── ITooltipBlock.java
│ │ ├── IPropertyIgnore.java
│ │ ├── ITagGetter.java
│ │ ├── ISidedRenderingBlock.java
│ │ ├── ITexturePath.java
│ │ └── DCTileEntity.java
│ ├── packet
│ │ ├── IClimateUpdateTile.java
│ │ ├── command
│ │ │ ├── IForcedSeason.java
│ │ │ ├── MessageComConfig.java
│ │ │ ├── MessageComSeason.java
│ │ │ ├── MessageComDrought.java
│ │ │ ├── ForcedSeason.java
│ │ │ ├── MHandlerComDrought.java
│ │ │ ├── MHandlerComSeason.java
│ │ │ └── MHandlerComConfig.java
│ │ ├── MessageCharmKey.java
│ │ ├── MHandlerWeatherUpdate.java
│ │ ├── MessageClimateUpdate.java
│ │ ├── MessageWeatherUpdate.java
│ │ ├── MHandlerClimateTile.java
│ │ ├── MessageTorqueTile.java
│ │ ├── MHandlerCharmKey.java
│ │ ├── MHandlerTorqueTile.java
│ │ └── HaCPacket.java
│ ├── plugin
│ │ ├── jei
│ │ │ ├── ingredients
│ │ │ │ ├── ClimateTypes.java
│ │ │ │ ├── Airflow.java
│ │ │ │ ├── HeatTier.java
│ │ │ │ ├── Humidity.java
│ │ │ │ ├── AirflowRenderer.java
│ │ │ │ ├── HumidityRenderer.java
│ │ │ │ └── HeatTierRenderer.java
│ │ │ ├── MillRecipeMaker.java
│ │ │ ├── FluidRecipeMaker.java
│ │ │ ├── ClimateEffectiveMaker.java
│ │ │ ├── CrusherRecipeMaker.java
│ │ │ ├── ReactorRecipeMaker.java
│ │ │ ├── SpinningRecipeMaker.java
│ │ │ ├── ShapelessNBTWrapper.java
│ │ │ ├── ClimateBiomeMaker.java
│ │ │ ├── ClimateSmeltingMaker.java
│ │ │ ├── ClimateCropMaker.java
│ │ │ ├── ShapedNBTWrapper.java
│ │ │ ├── ClimateBiomeHandler.java
│ │ │ ├── FRecipeType.java
│ │ │ ├── ClimateEffectiveHandler.java
│ │ │ ├── MillRecipeHandler.java
│ │ │ ├── CrusherRecipeHandler.java
│ │ │ ├── SpinningRecipeHandler.java
│ │ │ ├── ClimateSmeltingHandler.java
│ │ │ ├── ClimateCropHandler.java
│ │ │ ├── CRecipeType.java
│ │ │ ├── FluidRecipeHandler.java
│ │ │ ├── ReactorRecipeHandler.java
│ │ │ └── SpinningRecipeWrapper.java
│ │ ├── main
│ │ │ └── MainComHelper.java
│ │ ├── ChastMobPlugin.java
│ │ ├── baubles
│ │ │ ├── CharmItemBase.java
│ │ │ └── DCPluginBaubles.java
│ │ └── DCsJEIPluginLists.java
│ ├── DCInit.java
│ ├── util
│ │ ├── RecipeResources.java
│ │ ├── PotionFreezeResistance.java
│ │ ├── BiomeCatchDC.java
│ │ └── DCWaterOpaque.java
│ ├── energy
│ │ ├── ISidedEnergyStorage.java
│ │ └── SidedEnergyWrapper.java
│ ├── event
│ │ ├── ElytraFlyingDC.java
│ │ ├── AttachCapabilityDC.java
│ │ ├── TickEventDC.java
│ │ ├── EntityAIRunFromHeatsource.java
│ │ ├── SuffocationEventDC.java
│ │ └── CoreAnvilEvent.java
│ ├── DCLogger.java
│ ├── recipe
│ │ ├── HaCRecipeCondition.java
│ │ └── ConvertTargetList.java
│ ├── climate
│ │ ├── recipe
│ │ │ └── ClimateCropRegister.java
│ │ ├── ClimateHelper.java
│ │ └── ThermalInsulationUtil.java
│ ├── fluid
│ │ └── FluidDic.java
│ └── CreativeTabClimate.java
│ ├── config
│ └── recipe
│ │ └── EnumRecipeReg.java
│ └── asm
│ ├── DCEventFactory.java
│ ├── DCASMCore.java
│ └── DCASMPlugin.java
└── .gitignore
/main/resources/Contributors.txt:
--------------------------------------------------------------------------------
1 | ## Contributors ##
2 | special thanks!
3 |
4 | mrAppleXZ: performance fix
5 |
6 |
--------------------------------------------------------------------------------
/main/resources/assets/dcs_climate/models/item/dcs_cube_tb.json:
--------------------------------------------------------------------------------
1 | {
2 | "parent": "dcs_climate:block/dcs_cube_tb",
3 | }
--------------------------------------------------------------------------------
/main/resources/assets/dcs_climate/models/item/dcs_cube_sided.json:
--------------------------------------------------------------------------------
1 | {
2 | "parent": "dcs_climate:block/dcs_cube_sided",
3 | }
--------------------------------------------------------------------------------
/main/resources/assets/dcs_climate/models/item/dcs_slab_under_base.json:
--------------------------------------------------------------------------------
1 | {
2 | "parent": "dcs_climate:block/dcs_slab_under_base",
3 | }
--------------------------------------------------------------------------------
/main/resources/assets/dcs_climate/models/item/dcs_slab_upper_base.json:
--------------------------------------------------------------------------------
1 | {
2 | "parent": "dcs_climate:block/dcs_slab_upper_base",
3 | }
--------------------------------------------------------------------------------
/main/java/defeatedcrow/hac/api/energy/IWrenchDC.java:
--------------------------------------------------------------------------------
1 | package defeatedcrow.hac.api.energy;
2 |
3 | public interface IWrenchDC {
4 |
5 | }
6 |
--------------------------------------------------------------------------------
/main/resources/META-INF/haclib_at.cfg:
--------------------------------------------------------------------------------
1 | # animal feeding items
2 | public net.minecraft.entity.ai.EntityAITempt field_151484_k # temptItem
3 |
--------------------------------------------------------------------------------
/main/resources/assets/dcs_climate/models/item/dcs_stairs_glass.json:
--------------------------------------------------------------------------------
1 | {
2 | "parent": "dcs_climate:block/build/dcs_stairs_glass",
3 | }
4 |
--------------------------------------------------------------------------------
/main/resources/assets/dcs_climate/models/item/dcs_stairs_gypsum.json:
--------------------------------------------------------------------------------
1 | {
2 | "parent": "dcs_climate:block/build/dcs_stairs_gypsum",
3 | }
4 |
--------------------------------------------------------------------------------
/main/resources/assets/dcs_climate/models/item/tool/checker0.json:
--------------------------------------------------------------------------------
1 | {"parent":"item/generated","textures":{"layer0":"dcs_climate:items/tool/checker"}}
2 |
--------------------------------------------------------------------------------
/main/resources/assets/dcs_climate/blockstates/basetile.json:
--------------------------------------------------------------------------------
1 | {
2 | "variants": {
3 | "normal": { "model": "dcs_climate:basetile" }
4 | }
5 | }
--------------------------------------------------------------------------------
/main/resources/assets/dcs_climate/blockstates/dcs_cross.json:
--------------------------------------------------------------------------------
1 | {
2 | "variants": {
3 | "normal": { "model": "dcs_climate:dcs_cross" }
4 | }
5 | }
--------------------------------------------------------------------------------
/main/resources/pack.mcmeta:
--------------------------------------------------------------------------------
1 | {
2 | "pack": {
3 | "description": "resources of HeatAndClimateLib",
4 | "pack_format": 3
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/main/resources/assets/dcs_climate/blockstates/dcs_cube_tb.json:
--------------------------------------------------------------------------------
1 | {
2 | "variants": {
3 | "normal": { "model": "dcs_climate:dcs_cube_tb" }
4 | }
5 | }
--------------------------------------------------------------------------------
/main/resources/assets/dcs_climate/blockstates/dcs_cube_sided.json:
--------------------------------------------------------------------------------
1 | {
2 | "variants": {
3 | "normal": { "model": "dcs_climate:dcs_cube_sided" }
4 | }
5 | }
--------------------------------------------------------------------------------
/main/resources/assets/dcs_climate/models/item/basetile.json:
--------------------------------------------------------------------------------
1 | {
2 | "parent": "item/generated",
3 | "textures": {
4 | "layer0": "items/apple"
5 | }
6 | }
--------------------------------------------------------------------------------
/main/resources/assets/dcs_climate/recipes/_factories.json:
--------------------------------------------------------------------------------
1 | {
2 | "conditions": {
3 | "recipe_enabled": "defeatedcrow.hac.core.recipe.HaCRecipeCondition"
4 | }
5 | }
--------------------------------------------------------------------------------
/main/java/defeatedcrow/hac/core/client/event/ViewerMode.java:
--------------------------------------------------------------------------------
1 | package defeatedcrow.hac.core.client.event;
2 |
3 | public enum ViewerMode {
4 | TEMP, HUM, WIND, NONE;
5 | }
6 |
--------------------------------------------------------------------------------
/main/resources/META-INF/MANIFEST.MF:
--------------------------------------------------------------------------------
1 | Manifest-Version: 1.0
2 | FMLCorePlugin: defeatedcrow.hac.asm.DCASMPlugin
3 | FMLCorePluginContainsFMLMod: true
4 | FMLAT: haclib_at.cfg
5 |
--------------------------------------------------------------------------------
/main/java/defeatedcrow/hac/core/base/INameSuffix.java:
--------------------------------------------------------------------------------
1 | package defeatedcrow.hac.core.base;
2 |
3 | public interface INameSuffix {
4 |
5 | String[] getNameSuffix();
6 |
7 | }
8 |
--------------------------------------------------------------------------------
/main/resources/assets/dcs_climate/blockstates/dcs_slab_under_base.json:
--------------------------------------------------------------------------------
1 | {
2 | "variants": {
3 | "side=false": { "model": "dcs_climate:dcs_slab_under_base" }
4 | }
5 | }
--------------------------------------------------------------------------------
/main/resources/assets/dcs_climate/blockstates/dcs_slab_upper_base.json:
--------------------------------------------------------------------------------
1 | {
2 | "variants": {
3 | "side=true": { "model": "dcs_climate:dcs_slab_upper_base" }
4 | }
5 | }
--------------------------------------------------------------------------------
/main/resources/assets/dcs_climate/models/block/basetile.json:
--------------------------------------------------------------------------------
1 | {
2 | "parent": "dcs_climate:block/dcs_0",
3 | "textures": {
4 | "all": "blocks/bedrock"
5 | }
6 | }
--------------------------------------------------------------------------------
/main/resources/assets/dcs_climate/textures/gui/hud_hot.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/defeatedcrow/HeatAndClimateLib/HEAD/main/resources/assets/dcs_climate/textures/gui/hud_hot.png
--------------------------------------------------------------------------------
/main/java/defeatedcrow/hac/core/base/EnumStateType.java:
--------------------------------------------------------------------------------
1 | package defeatedcrow.hac.core.base;
2 |
3 | public enum EnumStateType {
4 | NORMAL,
5 | SIDE,
6 | FACING,
7 | CUSTOM;
8 | }
9 |
--------------------------------------------------------------------------------
/main/resources/assets/dcs_climate/textures/blocks/clear.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/defeatedcrow/HeatAndClimateLib/HEAD/main/resources/assets/dcs_climate/textures/blocks/clear.png
--------------------------------------------------------------------------------
/main/resources/assets/dcs_climate/textures/gui/gui_icons.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/defeatedcrow/HeatAndClimateLib/HEAD/main/resources/assets/dcs_climate/textures/gui/gui_icons.png
--------------------------------------------------------------------------------
/main/resources/assets/dcs_climate/textures/gui/hud_cold.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/defeatedcrow/HeatAndClimateLib/HEAD/main/resources/assets/dcs_climate/textures/gui/hud_cold.png
--------------------------------------------------------------------------------
/main/resources/assets/dcs_climate/textures/gui/icon_base.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/defeatedcrow/HeatAndClimateLib/HEAD/main/resources/assets/dcs_climate/textures/gui/icon_base.png
--------------------------------------------------------------------------------
/main/resources/assets/dcs_climate/textures/gui/icon_boil.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/defeatedcrow/HeatAndClimateLib/HEAD/main/resources/assets/dcs_climate/textures/gui/icon_boil.png
--------------------------------------------------------------------------------
/main/resources/assets/dcs_climate/textures/gui/icon_cold.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/defeatedcrow/HeatAndClimateLib/HEAD/main/resources/assets/dcs_climate/textures/gui/icon_cold.png
--------------------------------------------------------------------------------
/main/resources/assets/dcs_climate/textures/gui/icon_cool.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/defeatedcrow/HeatAndClimateLib/HEAD/main/resources/assets/dcs_climate/textures/gui/icon_cool.png
--------------------------------------------------------------------------------
/main/resources/assets/dcs_climate/textures/gui/icon_hot.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/defeatedcrow/HeatAndClimateLib/HEAD/main/resources/assets/dcs_climate/textures/gui/icon_hot.png
--------------------------------------------------------------------------------
/main/resources/assets/dcs_climate/textures/gui/icon_kiln.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/defeatedcrow/HeatAndClimateLib/HEAD/main/resources/assets/dcs_climate/textures/gui/icon_kiln.png
--------------------------------------------------------------------------------
/main/resources/assets/dcs_climate/textures/gui/icon_oven.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/defeatedcrow/HeatAndClimateLib/HEAD/main/resources/assets/dcs_climate/textures/gui/icon_oven.png
--------------------------------------------------------------------------------
/main/resources/assets/dcs_climate/textures/gui/icon_uht.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/defeatedcrow/HeatAndClimateLib/HEAD/main/resources/assets/dcs_climate/textures/gui/icon_uht.png
--------------------------------------------------------------------------------
/main/resources/assets/dcs_climate/textures/gui/icon_warm.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/defeatedcrow/HeatAndClimateLib/HEAD/main/resources/assets/dcs_climate/textures/gui/icon_warm.png
--------------------------------------------------------------------------------
/main/java/defeatedcrow/hac/api/recipe/IRecipePanel.java:
--------------------------------------------------------------------------------
1 | package defeatedcrow.hac.api.recipe;
2 |
3 | /**
4 | * AMTにあったカルセドニーパネルの後継
5 | */
6 | public interface IRecipePanel {
7 |
8 | }
9 |
--------------------------------------------------------------------------------
/main/resources/assets/dcs_climate/textures/gui/c_biome_gui.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/defeatedcrow/HeatAndClimateLib/HEAD/main/resources/assets/dcs_climate/textures/gui/c_biome_gui.png
--------------------------------------------------------------------------------
/main/resources/assets/dcs_climate/textures/gui/c_fluid_gui.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/defeatedcrow/HeatAndClimateLib/HEAD/main/resources/assets/dcs_climate/textures/gui/c_fluid_gui.png
--------------------------------------------------------------------------------
/main/resources/assets/dcs_climate/textures/gui/hud_climate.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/defeatedcrow/HeatAndClimateLib/HEAD/main/resources/assets/dcs_climate/textures/gui/hud_climate.png
--------------------------------------------------------------------------------
/main/resources/assets/dcs_climate/textures/gui/icon_inferno.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/defeatedcrow/HeatAndClimateLib/HEAD/main/resources/assets/dcs_climate/textures/gui/icon_inferno.png
--------------------------------------------------------------------------------
/main/resources/assets/dcs_climate/textures/gui/icon_normal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/defeatedcrow/HeatAndClimateLib/HEAD/main/resources/assets/dcs_climate/textures/gui/icon_normal.png
--------------------------------------------------------------------------------
/main/resources/assets/dcs_climate/textures/gui/icons_potion.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/defeatedcrow/HeatAndClimateLib/HEAD/main/resources/assets/dcs_climate/textures/gui/icons_potion.png
--------------------------------------------------------------------------------
/main/resources/assets/dcs_climate/textures/gui/info_gui_jei.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/defeatedcrow/HeatAndClimateLib/HEAD/main/resources/assets/dcs_climate/textures/gui/info_gui_jei.png
--------------------------------------------------------------------------------
/main/resources/assets/dcs_climate/textures/items/food/flour.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/defeatedcrow/HeatAndClimateLib/HEAD/main/resources/assets/dcs_climate/textures/items/food/flour.png
--------------------------------------------------------------------------------
/main/resources/assets/dcs_climate/textures/tiles/stove_fuel.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/defeatedcrow/HeatAndClimateLib/HEAD/main/resources/assets/dcs_climate/textures/tiles/stove_fuel.png
--------------------------------------------------------------------------------
/main/java/defeatedcrow/hac/api/recipe/IRecipeCatalyst.java:
--------------------------------------------------------------------------------
1 | package defeatedcrow.hac.api.recipe;
2 |
3 | /**
4 | * for ReactorRecipe
5 | */
6 | public interface IRecipeCatalyst {
7 |
8 | }
9 |
--------------------------------------------------------------------------------
/main/resources/assets/dcs_climate/models/item/tool/checker1.json:
--------------------------------------------------------------------------------
1 | {
2 | "parent": "item/generated",
3 | "textures": {
4 | "layer0": "dcs_climate:items/tool/checker"
5 | }
6 | }
--------------------------------------------------------------------------------
/main/resources/assets/dcs_climate/textures/blocks/crop/shrub_1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/defeatedcrow/HeatAndClimateLib/HEAD/main/resources/assets/dcs_climate/textures/blocks/crop/shrub_1.png
--------------------------------------------------------------------------------
/main/resources/assets/dcs_climate/textures/blocks/gray_effect.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/defeatedcrow/HeatAndClimateLib/HEAD/main/resources/assets/dcs_climate/textures/blocks/gray_effect.png
--------------------------------------------------------------------------------
/main/resources/assets/dcs_climate/textures/gui/c_crafting_gui.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/defeatedcrow/HeatAndClimateLib/HEAD/main/resources/assets/dcs_climate/textures/gui/c_crafting_gui.png
--------------------------------------------------------------------------------
/main/resources/assets/dcs_climate/textures/gui/c_crops_gui_jei.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/defeatedcrow/HeatAndClimateLib/HEAD/main/resources/assets/dcs_climate/textures/gui/c_crops_gui_jei.png
--------------------------------------------------------------------------------
/main/resources/assets/dcs_climate/textures/gui/c_effective_gui.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/defeatedcrow/HeatAndClimateLib/HEAD/main/resources/assets/dcs_climate/textures/gui/c_effective_gui.png
--------------------------------------------------------------------------------
/main/resources/assets/dcs_climate/textures/gui/c_mill_gui_jei.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/defeatedcrow/HeatAndClimateLib/HEAD/main/resources/assets/dcs_climate/textures/gui/c_mill_gui_jei.png
--------------------------------------------------------------------------------
/main/resources/assets/dcs_climate/textures/gui/c_smelting_gui.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/defeatedcrow/HeatAndClimateLib/HEAD/main/resources/assets/dcs_climate/textures/gui/c_smelting_gui.png
--------------------------------------------------------------------------------
/main/resources/assets/dcs_climate/textures/gui/hud_climate_adv.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/defeatedcrow/HeatAndClimateLib/HEAD/main/resources/assets/dcs_climate/textures/gui/hud_climate_adv.png
--------------------------------------------------------------------------------
/main/resources/assets/dcs_climate/textures/gui/icon_absolute.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/defeatedcrow/HeatAndClimateLib/HEAD/main/resources/assets/dcs_climate/textures/gui/icon_absolute.png
--------------------------------------------------------------------------------
/main/resources/assets/dcs_climate/textures/gui/icon_cryogenic.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/defeatedcrow/HeatAndClimateLib/HEAD/main/resources/assets/dcs_climate/textures/gui/icon_cryogenic.png
--------------------------------------------------------------------------------
/main/resources/assets/dcs_climate/textures/gui/icon_frostbite.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/defeatedcrow/HeatAndClimateLib/HEAD/main/resources/assets/dcs_climate/textures/gui/icon_frostbite.png
--------------------------------------------------------------------------------
/main/resources/assets/dcs_climate/textures/gui/icon_smelting.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/defeatedcrow/HeatAndClimateLib/HEAD/main/resources/assets/dcs_climate/textures/gui/icon_smelting.png
--------------------------------------------------------------------------------
/main/resources/assets/dcs_climate/textures/gui/icons_potion_2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/defeatedcrow/HeatAndClimateLib/HEAD/main/resources/assets/dcs_climate/textures/gui/icons_potion_2.png
--------------------------------------------------------------------------------
/main/resources/assets/dcs_climate/textures/items/tool/checker.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/defeatedcrow/HeatAndClimateLib/HEAD/main/resources/assets/dcs_climate/textures/items/tool/checker.png
--------------------------------------------------------------------------------
/main/resources/assets/dcs_climate/textures/blocks/cont/woodbox_b.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/defeatedcrow/HeatAndClimateLib/HEAD/main/resources/assets/dcs_climate/textures/blocks/cont/woodbox_b.png
--------------------------------------------------------------------------------
/main/resources/assets/dcs_climate/textures/blocks/cont/woodbox_s.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/defeatedcrow/HeatAndClimateLib/HEAD/main/resources/assets/dcs_climate/textures/blocks/cont/woodbox_s.png
--------------------------------------------------------------------------------
/main/resources/assets/dcs_climate/textures/blocks/cont/woodbox_t.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/defeatedcrow/HeatAndClimateLib/HEAD/main/resources/assets/dcs_climate/textures/blocks/cont/woodbox_t.png
--------------------------------------------------------------------------------
/main/resources/assets/dcs_climate/textures/blocks/destroy_effect.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/defeatedcrow/HeatAndClimateLib/HEAD/main/resources/assets/dcs_climate/textures/blocks/destroy_effect.png
--------------------------------------------------------------------------------
/main/resources/assets/dcs_climate/textures/gui/c_crusher_gui_jei.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/defeatedcrow/HeatAndClimateLib/HEAD/main/resources/assets/dcs_climate/textures/gui/c_crusher_gui_jei.png
--------------------------------------------------------------------------------
/main/resources/assets/dcs_climate/textures/gui/c_reactor_gui_jei.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/defeatedcrow/HeatAndClimateLib/HEAD/main/resources/assets/dcs_climate/textures/gui/c_reactor_gui_jei.png
--------------------------------------------------------------------------------
/main/resources/assets/dcs_climate/textures/gui/chamber_fluid_gui.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/defeatedcrow/HeatAndClimateLib/HEAD/main/resources/assets/dcs_climate/textures/gui/chamber_fluid_gui.png
--------------------------------------------------------------------------------
/main/resources/assets/dcs_climate/textures/gui/chamber_main_gui.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/defeatedcrow/HeatAndClimateLib/HEAD/main/resources/assets/dcs_climate/textures/gui/chamber_main_gui.png
--------------------------------------------------------------------------------
/main/resources/assets/dcs_climate/textures/gui/fuellist_gui_jei.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/defeatedcrow/HeatAndClimateLib/HEAD/main/resources/assets/dcs_climate/textures/gui/fuellist_gui_jei.png
--------------------------------------------------------------------------------
/main/resources/assets/dcs_climate/textures/gui/hud_climate_rain.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/defeatedcrow/HeatAndClimateLib/HEAD/main/resources/assets/dcs_climate/textures/gui/hud_climate_rain.png
--------------------------------------------------------------------------------
/main/resources/assets/dcs_climate/textures/gui/c_crafting_gui_jei.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/defeatedcrow/HeatAndClimateLib/HEAD/main/resources/assets/dcs_climate/textures/gui/c_crafting_gui_jei.png
--------------------------------------------------------------------------------
/main/resources/assets/dcs_climate/textures/gui/c_fluidcraft_gui_jei.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/defeatedcrow/HeatAndClimateLib/HEAD/main/resources/assets/dcs_climate/textures/gui/c_fluidcraft_gui_jei.png
--------------------------------------------------------------------------------
/main/resources/assets/dcs_climate/textures/gui/c_smelting_gui_jei.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/defeatedcrow/HeatAndClimateLib/HEAD/main/resources/assets/dcs_climate/textures/gui/c_smelting_gui_jei.png
--------------------------------------------------------------------------------
/main/resources/assets/dcs_climate/textures/gui/chamber.normal.gui.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/defeatedcrow/HeatAndClimateLib/HEAD/main/resources/assets/dcs_climate/textures/gui/chamber.normal.gui.png
--------------------------------------------------------------------------------
/main/resources/assets/dcs_climate/textures/gui/fluidprocessor_gui.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/defeatedcrow/HeatAndClimateLib/HEAD/main/resources/assets/dcs_climate/textures/gui/fluidprocessor_gui.png
--------------------------------------------------------------------------------
/main/resources/assets/dcs_climate/textures/gui/hud_climate_drought.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/defeatedcrow/HeatAndClimateLib/HEAD/main/resources/assets/dcs_climate/textures/gui/hud_climate_drought.png
--------------------------------------------------------------------------------
/main/resources/assets/dcs_climate/textures/gui/hud_climate_normal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/defeatedcrow/HeatAndClimateLib/HEAD/main/resources/assets/dcs_climate/textures/gui/hud_climate_normal.png
--------------------------------------------------------------------------------
/main/resources/assets/dcs_climate/textures/items/block/stovefuel_item.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/defeatedcrow/HeatAndClimateLib/HEAD/main/resources/assets/dcs_climate/textures/items/block/stovefuel_item.png
--------------------------------------------------------------------------------
/main/resources/assets/dcs_climate/textures/items/food/roundbread_raw.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/defeatedcrow/HeatAndClimateLib/HEAD/main/resources/assets/dcs_climate/textures/items/food/roundbread_raw.png
--------------------------------------------------------------------------------
/main/java/defeatedcrow/hac/api/item/ICutleryItem.java:
--------------------------------------------------------------------------------
1 | package defeatedcrow.hac.api.item;
2 |
3 | /**
4 | * カトラリーツール
5 | * 右クリックで食べ物Entityを食べる。
6 | */
7 | public interface ICutleryItem {
8 |
9 | }
10 |
--------------------------------------------------------------------------------
/main/resources/assets/dcs_climate/textures/entity/food/round_bread_baked.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/defeatedcrow/HeatAndClimateLib/HEAD/main/resources/assets/dcs_climate/textures/entity/food/round_bread_baked.png
--------------------------------------------------------------------------------
/main/resources/assets/dcs_climate/textures/entity/food/round_bread_raw.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/defeatedcrow/HeatAndClimateLib/HEAD/main/resources/assets/dcs_climate/textures/entity/food/round_bread_raw.png
--------------------------------------------------------------------------------
/main/resources/assets/dcs_climate/textures/gui/hud_climate_thermometer.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/defeatedcrow/HeatAndClimateLib/HEAD/main/resources/assets/dcs_climate/textures/gui/hud_climate_thermometer.png
--------------------------------------------------------------------------------
/main/resources/assets/dcs_climate/textures/items/food/roundbread_baked.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/defeatedcrow/HeatAndClimateLib/HEAD/main/resources/assets/dcs_climate/textures/items/food/roundbread_baked.png
--------------------------------------------------------------------------------
/main/java/defeatedcrow/hac/api/magic/MagicType.java:
--------------------------------------------------------------------------------
1 | package defeatedcrow.hac.api.magic;
2 |
3 | public enum MagicType {
4 |
5 | PENDANT,
6 | BADGE,
7 | RING,
8 | AMULET,
9 | ARMOR,
10 | OFFHAND;
11 |
12 | }
13 |
--------------------------------------------------------------------------------
/main/java/defeatedcrow/hac/core/base/ITooltipBlock.java:
--------------------------------------------------------------------------------
1 | package defeatedcrow.hac.core.base;
2 |
3 | import java.util.List;
4 |
5 | public interface ITooltipBlock {
6 |
7 | List getAdvancedTooltip();
8 |
9 | }
10 |
--------------------------------------------------------------------------------
/main/resources/assets/dcs_climate/blockstates/dcs_slab_base.json:
--------------------------------------------------------------------------------
1 | {
2 | "variants": {
3 | "side=false": { "model": "dcs_climate:dcs_slab_under_base" },
4 | "side=true": { "model": "dcs_climate:dcs_slab_upper_base" }
5 | }
6 | }
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | *.class
2 | */*.db
3 |
4 | # Mobile Tools for Java (J2ME)
5 | .mtj.tmp/
6 |
7 | # Package Files #
8 | *.jar
9 | *.war
10 | *.ear
11 |
12 | # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
13 | hs_err_pid*
14 |
--------------------------------------------------------------------------------
/main/java/defeatedcrow/hac/core/client/event/IClimateViewer.java:
--------------------------------------------------------------------------------
1 | package defeatedcrow.hac.core.client.event;
2 |
3 | import net.minecraft.item.ItemStack;
4 |
5 | public interface IClimateViewer {
6 |
7 | public ViewerMode getMode(ItemStack item);
8 |
9 | }
10 |
--------------------------------------------------------------------------------
/main/java/defeatedcrow/hac/api/magic/IJewel.java:
--------------------------------------------------------------------------------
1 | package defeatedcrow.hac.api.magic;
2 |
3 | public abstract interface IJewel {
4 |
5 | CharmType getCharmType(int meta);
6 |
7 | MagicType getType(int meta);
8 |
9 | MagicColor getColor(int meta);
10 |
11 | }
12 |
--------------------------------------------------------------------------------
/main/java/defeatedcrow/hac/core/base/IPropertyIgnore.java:
--------------------------------------------------------------------------------
1 | package defeatedcrow.hac.core.base;
2 |
3 | import net.minecraft.block.properties.IProperty;
4 |
5 | public interface IPropertyIgnore {
6 |
7 | IProperty[] ignoreTarget();
8 |
9 | EnumStateType getType();
10 |
11 | }
12 |
--------------------------------------------------------------------------------
/main/java/defeatedcrow/hac/core/packet/IClimateUpdateTile.java:
--------------------------------------------------------------------------------
1 | package defeatedcrow.hac.core.packet;
2 |
3 | import defeatedcrow.hac.api.climate.IClimate;
4 |
5 | public interface IClimateUpdateTile {
6 |
7 | IClimate getClimate();
8 |
9 | void setClimate(int i);
10 |
11 | }
12 |
--------------------------------------------------------------------------------
/main/resources/assets/dcs_lib/lang/Lang_File_Contributers.txt:
--------------------------------------------------------------------------------
1 | ## Lang File Contributors ##
2 | I thank authors of each language files.
3 |
4 | en_US
5 | TartaricAcid
6 |
7 | zh_CN
8 | TartaricAcid
9 | Pliosauroidea
10 |
11 | zh_TW
12 | AileRozy
13 |
14 | ru_RU
15 | Sergey Akilin
16 |
17 |
--------------------------------------------------------------------------------
/main/java/defeatedcrow/hac/api/climate/IClimateIgnoreBlock.java:
--------------------------------------------------------------------------------
1 | package defeatedcrow.hac.api.climate;
2 |
3 | import net.minecraft.block.state.IBlockState;
4 |
5 | /*
6 | * 気候計算に寄与しないブロック
7 | */
8 | public interface IClimateIgnoreBlock {
9 |
10 | boolean isActive(IBlockState state);
11 |
12 | }
13 |
--------------------------------------------------------------------------------
/main/java/defeatedcrow/hac/api/energy/ICrankReceiver.java:
--------------------------------------------------------------------------------
1 | package defeatedcrow.hac.api.energy;
2 |
3 | public interface ICrankReceiver {
4 |
5 | boolean isPressed();
6 |
7 | boolean isMaxPressed();
8 |
9 | void setPressed(boolean flag);
10 |
11 | void setMaxPressed(boolean flag);
12 |
13 | }
14 |
--------------------------------------------------------------------------------
/main/java/defeatedcrow/hac/api/placeable/IItemDropEntity.java:
--------------------------------------------------------------------------------
1 | package defeatedcrow.hac.api.placeable;
2 |
3 | import net.minecraft.item.ItemStack;
4 |
5 | /**
6 | * 特定のItemをドロップするEntity。IEntityItemと対で使用する。
7 | */
8 | public interface IItemDropEntity {
9 |
10 | ItemStack getDropItem();
11 |
12 | }
13 |
--------------------------------------------------------------------------------
/main/java/defeatedcrow/hac/core/base/ITagGetter.java:
--------------------------------------------------------------------------------
1 | package defeatedcrow.hac.core.base;
2 |
3 | import net.minecraft.nbt.NBTTagCompound;
4 |
5 | public interface ITagGetter {
6 |
7 | public NBTTagCompound getNBT(NBTTagCompound tag);
8 |
9 | public void setNBT(NBTTagCompound tag);
10 |
11 | }
12 |
--------------------------------------------------------------------------------
/main/java/defeatedcrow/hac/api/climate/IHeatCanceler.java:
--------------------------------------------------------------------------------
1 | package defeatedcrow.hac.api.climate;
2 |
3 | import net.minecraft.block.state.IBlockState;
4 |
5 | /* 何らかの理由で真下の熱源を無効化したい場合に使用する
6 | /* ほぼ熱交換器専用
7 | * */
8 | public interface IHeatCanceler {
9 |
10 | boolean isActive(IBlockState state);
11 |
12 | }
13 |
--------------------------------------------------------------------------------
/main/java/defeatedcrow/hac/api/item/IAnimalFood.java:
--------------------------------------------------------------------------------
1 | package defeatedcrow.hac.api.item;
2 |
3 | import net.minecraft.entity.passive.EntityAnimal;
4 | import net.minecraft.item.ItemStack;
5 |
6 | public interface IAnimalFood {
7 |
8 | boolean isTargetAnimal(EntityAnimal entity, ItemStack item);
9 |
10 | }
11 |
--------------------------------------------------------------------------------
/main/resources/assets/dcs_climate/models/block/dcs_cube_3face.json:
--------------------------------------------------------------------------------
1 | {
2 | "parent": "dcs_climate:block/dcs_cube",
3 | "textures": {
4 | "top": "#td",
5 | "down": "#td",
6 | "north": "#ns",
7 | "south": "#ns",
8 | "west": "#we",
9 | "east": "#we"
10 | }
11 | }
--------------------------------------------------------------------------------
/main/java/defeatedcrow/hac/api/cultivate/CropAPI.java:
--------------------------------------------------------------------------------
1 | package defeatedcrow.hac.api.cultivate;
2 |
3 | /**
4 | * 気候の登録や参照はここから行って下さい
5 | */
6 | public class CropAPI {
7 |
8 | private CropAPI() {
9 | }
10 |
11 | public static boolean isLoaded;
12 |
13 | public static IClimateCropRegister register;
14 |
15 | }
16 |
--------------------------------------------------------------------------------
/main/resources/assets/dcs_climate/models/block/dcs_cube_all.json:
--------------------------------------------------------------------------------
1 | {
2 | "parent": "dcs_climate:block/dcs_cube",
3 | "textures": {
4 | "top": "#all",
5 | "down": "#all",
6 | "north": "#all",
7 | "south": "#all",
8 | "west": "#all",
9 | "east": "#all"
10 | }
11 | }
--------------------------------------------------------------------------------
/main/java/defeatedcrow/hac/core/base/ISidedRenderingBlock.java:
--------------------------------------------------------------------------------
1 | package defeatedcrow.hac.core.base;
2 |
3 | import net.minecraft.block.state.IBlockState;
4 | import net.minecraft.util.EnumFacing;
5 |
6 | public interface ISidedRenderingBlock {
7 |
8 | boolean isRendered(EnumFacing face, IBlockState state);
9 |
10 | }
11 |
--------------------------------------------------------------------------------
/main/java/defeatedcrow/hac/core/base/ITexturePath.java:
--------------------------------------------------------------------------------
1 | package defeatedcrow.hac.core.base;
2 |
3 | /*
4 | * ItemやBlockなどの多種のオブジェクトとテクスチャパスを紐付けるインターフェイス。
5 | * 主にJson自動生成用
6 | */
7 | public interface ITexturePath {
8 |
9 | /**
10 | * Json用
11 | */
12 | String getTexPath(int meta, boolean isFull);
13 |
14 | }
15 |
--------------------------------------------------------------------------------
/main/java/defeatedcrow/hac/api/energy/ICrankDC.java:
--------------------------------------------------------------------------------
1 | package defeatedcrow.hac.api.energy;
2 |
3 | import net.minecraft.util.EnumFacing;
4 |
5 | public interface ICrankDC {
6 |
7 | /*
8 | * + -> 押す
9 | * - -> 引く
10 | */
11 | float outputPower();
12 |
13 | // 動力を出力できるか
14 | boolean isOutputSide(EnumFacing side);
15 | }
16 |
--------------------------------------------------------------------------------
/main/java/defeatedcrow/hac/api/climate/IAirflowTile.java:
--------------------------------------------------------------------------------
1 | package defeatedcrow.hac.api.climate;
2 |
3 | import net.minecraft.util.math.BlockPos;
4 | import net.minecraft.world.World;
5 |
6 | /** Blockに実装するもの */
7 | public interface IAirflowTile {
8 |
9 | DCAirflow getAirflow(World world, BlockPos targrt, BlockPos source);
10 |
11 | }
12 |
--------------------------------------------------------------------------------
/main/java/defeatedcrow/hac/api/climate/IHeatTile.java:
--------------------------------------------------------------------------------
1 | package defeatedcrow.hac.api.climate;
2 |
3 | import net.minecraft.util.math.BlockPos;
4 | import net.minecraft.world.World;
5 |
6 | /** Blockに実装するもの。 */
7 | public interface IHeatTile {
8 |
9 | DCHeatTier getHeatTier(World world, BlockPos targrt, BlockPos source);
10 |
11 | }
12 |
--------------------------------------------------------------------------------
/main/java/defeatedcrow/hac/api/climate/IHumidityTile.java:
--------------------------------------------------------------------------------
1 | package defeatedcrow.hac.api.climate;
2 |
3 | import net.minecraft.util.math.BlockPos;
4 | import net.minecraft.world.World;
5 |
6 | /** Blockに実装するもの */
7 | public interface IHumidityTile {
8 |
9 | DCHumidity getHumidity(World world, BlockPos targrt, BlockPos source);
10 |
11 | }
12 |
--------------------------------------------------------------------------------
/main/java/defeatedcrow/hac/api/placeable/ISidedTexture.java:
--------------------------------------------------------------------------------
1 | package defeatedcrow.hac.api.placeable;
2 |
3 | /**
4 | * ModelBakedEventで使用するBlockのTextureパス指定。
5 | * Jsonに使用するものではない。
6 | */
7 | public interface ISidedTexture {
8 |
9 | /**
10 | * ModelBakedEvent用
11 | */
12 | String getTexture(int meta, int side, boolean face);
13 |
14 | }
15 |
--------------------------------------------------------------------------------
/main/java/defeatedcrow/hac/core/plugin/jei/ingredients/ClimateTypes.java:
--------------------------------------------------------------------------------
1 | package defeatedcrow.hac.core.plugin.jei.ingredients;
2 |
3 | public class ClimateTypes {
4 |
5 | public static final Airflow AIR = new Airflow();
6 | public static final Humidity HUM = new Humidity();
7 | public static final HeatTier TEMP = new HeatTier();
8 |
9 | }
10 |
--------------------------------------------------------------------------------
/main/java/defeatedcrow/hac/core/packet/command/IForcedSeason.java:
--------------------------------------------------------------------------------
1 | package defeatedcrow.hac.core.packet.command;
2 |
3 | import defeatedcrow.hac.api.climate.EnumSeason;
4 |
5 | public interface IForcedSeason {
6 |
7 | EnumSeason getSeason();
8 |
9 | void setForcedSeason(EnumSeason season);
10 |
11 | boolean isForced();
12 |
13 | void setForced(boolean b);
14 | }
15 |
--------------------------------------------------------------------------------
/main/java/defeatedcrow/hac/api/damage/DamageAPI.java:
--------------------------------------------------------------------------------
1 | package defeatedcrow.hac.api.damage;
2 |
3 | public class DamageAPI {
4 |
5 | private DamageAPI() {}
6 |
7 | public static boolean isLoaded;
8 |
9 | public static IArmorMaterialRegister armorRegister;
10 | public static IArmorItemRegister itemRegister;
11 | public static IMobHeatResistant resistantData;
12 |
13 | }
14 |
--------------------------------------------------------------------------------
/main/java/defeatedcrow/hac/api/package-info.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) defeatedcrow, 2016
3 | * URL:http://defeatedcrow.jp/modwiki/Mainpage
4 | * Please check the License.txt included in the package file of this Mod.
5 | */
6 |
7 | @API(apiVersion = "3.8.3", owner = "dcs_lib", provides = "DCsHaCAPI|core")
8 | package defeatedcrow.hac.api;
9 |
10 | import net.minecraftforge.fml.common.API;
11 |
--------------------------------------------------------------------------------
/main/java/defeatedcrow/hac/core/DCInit.java:
--------------------------------------------------------------------------------
1 | package defeatedcrow.hac.core;
2 |
3 | import net.minecraft.item.Item;
4 | import net.minecraft.potion.Potion;
5 | import net.minecraft.potion.PotionType;
6 |
7 | public class DCInit {
8 | private DCInit() {}
9 |
10 | public static Item climate_checker;
11 |
12 | public static Potion prevFreeze;
13 | public static PotionType prevFreezeType;
14 | }
15 |
--------------------------------------------------------------------------------
/main/java/defeatedcrow/hac/api/energy/ITorqueReceiver.java:
--------------------------------------------------------------------------------
1 | package defeatedcrow.hac.api.energy;
2 |
3 | import net.minecraft.util.EnumFacing;
4 |
5 | /**
6 | * トルクを受け取るTileEntityに実装するもの
7 | */
8 | public interface ITorqueReceiver extends ITorqueDC {
9 |
10 | boolean canReceiveTorque(float amount, EnumFacing side);
11 |
12 | float receiveTorque(float amount, EnumFacing side, boolean sim);
13 | }
14 |
--------------------------------------------------------------------------------
/main/java/defeatedcrow/hac/api/hook/package-info.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) defeatedcrow, 2016
3 | * URL:http://defeatedcrow.jp/modwiki/Mainpage
4 | * Please check the License.txt included in the package file of this Mod.
5 | */
6 |
7 | @API(apiVersion = "3.4.0", owner = "dcs_lib", provides = "DCsHaCAPI|hook")
8 | package defeatedcrow.hac.api.hook;
9 |
10 | import net.minecraftforge.fml.common.API;
11 |
--------------------------------------------------------------------------------
/main/java/defeatedcrow/hac/api/item/package-info.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) defeatedcrow, 2016
3 | * URL:http://defeatedcrow.jp/modwiki/Mainpage
4 | * Please check the License.txt included in the package file of this Mod.
5 | */
6 |
7 | @API(apiVersion = "3.4.0", owner = "dcs_lib", provides = "DCsHaCAPI|item")
8 | package defeatedcrow.hac.api.item;
9 |
10 | import net.minecraftforge.fml.common.API;
11 |
--------------------------------------------------------------------------------
/main/java/defeatedcrow/hac/api/cultivate/IClimateCropRegister.java:
--------------------------------------------------------------------------------
1 | package defeatedcrow.hac.api.cultivate;
2 |
3 | import java.util.Map;
4 |
5 | /**
6 | * JEI対応用の登録インターフェイス。
7 | * ここに登録しなくても、動作はする。
8 | */
9 | public interface IClimateCropRegister {
10 |
11 | /**
12 | * Recipeのリストを得る。
13 | */
14 | Map getList();
15 |
16 | void addCropData(IClimateCrop block);
17 |
18 | }
19 |
--------------------------------------------------------------------------------
/main/java/defeatedcrow/hac/api/module/package-info.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) defeatedcrow, 2016
3 | * URL:http://defeatedcrow.jp/modwiki/Mainpage
4 | * Please check the License.txt included in the package file of this Mod.
5 | */
6 |
7 | @API(apiVersion = "3.8.0", owner = "dcs_lib", provides = "DCsHaCAPI|module")
8 | package defeatedcrow.hac.api.module;
9 |
10 | import net.minecraftforge.fml.common.API;
11 |
--------------------------------------------------------------------------------
/main/java/defeatedcrow/hac/core/plugin/jei/ingredients/Airflow.java:
--------------------------------------------------------------------------------
1 | package defeatedcrow.hac.core.plugin.jei.ingredients;
2 |
3 | import defeatedcrow.hac.api.climate.DCAirflow;
4 | import mezz.jei.api.recipe.IIngredientType;
5 |
6 | public class Airflow implements IIngredientType{
7 |
8 | @Override
9 | public Class extends DCAirflow> getIngredientClass() {
10 | return DCAirflow.class;
11 | }
12 |
13 | }
14 |
--------------------------------------------------------------------------------
/main/java/defeatedcrow/hac/core/plugin/jei/ingredients/HeatTier.java:
--------------------------------------------------------------------------------
1 | package defeatedcrow.hac.core.plugin.jei.ingredients;
2 |
3 | import defeatedcrow.hac.api.climate.DCHeatTier;
4 | import mezz.jei.api.recipe.IIngredientType;
5 |
6 | public class HeatTier implements IIngredientType {
7 |
8 | @Override
9 | public Class extends DCHeatTier> getIngredientClass() {
10 | return DCHeatTier.class;
11 | }
12 |
13 | }
14 |
--------------------------------------------------------------------------------
/main/java/defeatedcrow/hac/core/plugin/jei/ingredients/Humidity.java:
--------------------------------------------------------------------------------
1 | package defeatedcrow.hac.core.plugin.jei.ingredients;
2 |
3 | import defeatedcrow.hac.api.climate.DCHumidity;
4 | import mezz.jei.api.recipe.IIngredientType;
5 |
6 | public class Humidity implements IIngredientType {
7 |
8 | @Override
9 | public Class extends DCHumidity> getIngredientClass() {
10 | return DCHumidity.class;
11 | }
12 |
13 | }
14 |
--------------------------------------------------------------------------------
/main/java/defeatedcrow/hac/api/magic/CharmType.java:
--------------------------------------------------------------------------------
1 | package defeatedcrow.hac.api.magic;
2 |
3 | public enum CharmType {
4 |
5 | /* 常時発動型 */
6 | CONSTANT,
7 | /* 被ダメージ時 追加効果 */
8 | DEFFENCE,
9 | /* 攻撃追加効果 */
10 | ATTACK,
11 | /* プレイヤー攻撃追加効果 */
12 | PLAYER_ATTACK,
13 | /* ツール使用時追加効果 */
14 | TOOL,
15 | /* 右クリック使用による任意発動型 */
16 | INSTANT,
17 | /* Xキーによる任意発動型 */
18 | KEY,
19 | /* どれにも当てはまらず、直接指定で効果を扱うもの */
20 | SPECIAL;
21 |
22 | }
23 |
--------------------------------------------------------------------------------
/main/java/defeatedcrow/hac/config/recipe/EnumRecipeReg.java:
--------------------------------------------------------------------------------
1 | package defeatedcrow.hac.config.recipe;
2 |
3 | public enum EnumRecipeReg {
4 |
5 | ADD,
6 | REPLACE,
7 | REMOVE;
8 |
9 | public static EnumRecipeReg getFromName(String name) {
10 | if (name != null)
11 | for (EnumRecipeReg t : EnumRecipeReg.values()) {
12 | if (t.name().equalsIgnoreCase(name)) {
13 | return t;
14 | }
15 | }
16 | return ADD;
17 | }
18 |
19 | }
20 |
--------------------------------------------------------------------------------
/main/resources/ReadMe_Plugin.txt:
--------------------------------------------------------------------------------
1 | #### Heat&Climate Lib Plugins for Other Mods ####
2 |
3 | HeatAndClimateには他Modに対する連携要素をいくつか追加しています。
4 | 対象Modのバージョンが異なる場合、動かない可能性もありますのでご注意下さい。
5 |
6 | コンフィグのある連携要素は、モジュール用コンフィグファイル(module.cfg)でオフに出来ます。ご活用下さい。
7 |
8 | * JEI (4.16.1.301)
9 | 各種レシピを確認できます。
10 |
11 | * Baubles (1.12-1.5.2)
12 | - 宝石チャーム、アミュレットをBaublesスロットに入れても動作します。
13 |
14 | * ChastMob (3.0.0)
15 | - チャストモブへのインベントリアクセス、およびインベントリ内のアミュレットの起動判定
16 |
17 |
--------------------------------------------------------------------------------
/main/resources/assets/dcs_climate/recipes/core/dcs_bread_0.json:
--------------------------------------------------------------------------------
1 | {
2 | "type": "forge:ore_shaped",
3 | "pattern": [
4 | "YYY"
5 | ],
6 | "key": {
7 | "Y": {
8 | "type": "forge:ore_dict",
9 | "ore": "foodFlour"
10 | }
11 | },
12 | "result": {
13 | "item": "minecraft:bread",
14 | "count": 1,
15 | "data": 0
16 | },
17 | "conditions": [
18 | {
19 | "type": "dcs_climate:recipe_enabled",
20 | "module": "core"
21 | }
22 | ]
23 | }
--------------------------------------------------------------------------------
/main/java/defeatedcrow/hac/api/item/IAnvilTool.java:
--------------------------------------------------------------------------------
1 | package defeatedcrow.hac.api.item;
2 |
3 | import net.minecraft.item.ItemStack;
4 |
5 | /**
6 | * 金床ツール
7 | * 金床でアイテムに対して使用できるツール。
8 | */
9 | public interface IAnvilTool {
10 |
11 | boolean canEnhance(ItemStack target, ItemStack tool);
12 |
13 | ItemStack getEnhancedItem(ItemStack target, ItemStack tool);
14 |
15 | int getMaterialCost(int meta);
16 |
17 | int getCost(int meta);
18 |
19 | }
20 |
--------------------------------------------------------------------------------
/main/java/defeatedcrow/hac/core/plugin/jei/MillRecipeMaker.java:
--------------------------------------------------------------------------------
1 | package defeatedcrow.hac.core.plugin.jei;
2 |
3 | import defeatedcrow.hac.api.recipe.RecipeAPI;
4 | import mezz.jei.api.IModRegistry;
5 |
6 | public final class MillRecipeMaker {
7 |
8 | private MillRecipeMaker() {}
9 |
10 | public static void register(IModRegistry registry) {
11 | registry.addRecipes(RecipeAPI.registerMills.getRecipeList(), DCsJEIPlugin.MILL_UID);
12 | }
13 |
14 | }
15 |
--------------------------------------------------------------------------------
/main/java/defeatedcrow/hac/api/climate/ClimateAPI.java:
--------------------------------------------------------------------------------
1 | package defeatedcrow.hac.api.climate;
2 |
3 | /**
4 | * 気候の登録や参照はここから行って下さい
5 | */
6 | public class ClimateAPI {
7 |
8 | private ClimateAPI() {}
9 |
10 | public static boolean isLoaded;
11 |
12 | public static IBiomeClimateRegister register;
13 | public static IHeatBlockRegister registerBlock;
14 | public static IClimateCalculator calculator;
15 | public static IClimateHelper helper;
16 |
17 | }
18 |
--------------------------------------------------------------------------------
/main/java/defeatedcrow/hac/api/damage/package-info.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) defeatedcrow, 2016
3 | * URL:http://defeatedcrow.jp/modwiki/Mainpage
4 | * Please check the License.txt included in the package file of this Mod.
5 | */
6 |
7 | /**
8 | * このAPIは、気候によるモブへのダメージを扱います。
9 | */
10 | @API(apiVersion = "3.6.0", owner = "dcs_lib", provides = "DCsHaCAPI|damage")
11 | package defeatedcrow.hac.api.damage;
12 |
13 | import net.minecraftforge.fml.common.API;
14 |
--------------------------------------------------------------------------------
/main/java/defeatedcrow/hac/core/plugin/jei/FluidRecipeMaker.java:
--------------------------------------------------------------------------------
1 | package defeatedcrow.hac.core.plugin.jei;
2 |
3 | import defeatedcrow.hac.api.recipe.RecipeAPI;
4 | import mezz.jei.api.IModRegistry;
5 |
6 | public final class FluidRecipeMaker {
7 |
8 | private FluidRecipeMaker() {}
9 |
10 | public static void register(IModRegistry registry) {
11 | registry.addRecipes(RecipeAPI.registerFluidRecipes.getRecipeList(), DCsJEIPlugin.FLUID_UID);
12 | }
13 |
14 | }
15 |
--------------------------------------------------------------------------------
/main/java/defeatedcrow/hac/core/plugin/jei/ClimateEffectiveMaker.java:
--------------------------------------------------------------------------------
1 | package defeatedcrow.hac.core.plugin.jei;
2 |
3 | import defeatedcrow.hac.core.plugin.DCsJEIPluginLists;
4 | import mezz.jei.api.IModRegistry;
5 |
6 | public final class ClimateEffectiveMaker {
7 |
8 | private ClimateEffectiveMaker() {}
9 |
10 | public static void register(IModRegistry registry) {
11 | registry.addRecipes(DCsJEIPluginLists.climate, DCsJEIPlugin.CLIMATE_UID);
12 | }
13 |
14 | }
15 |
--------------------------------------------------------------------------------
/main/java/defeatedcrow/hac/core/plugin/jei/CrusherRecipeMaker.java:
--------------------------------------------------------------------------------
1 | package defeatedcrow.hac.core.plugin.jei;
2 |
3 | import defeatedcrow.hac.api.recipe.RecipeAPI;
4 | import mezz.jei.api.IModRegistry;
5 |
6 | public final class CrusherRecipeMaker {
7 |
8 | private CrusherRecipeMaker() {}
9 |
10 | public static void register(IModRegistry registry) {
11 | registry.addRecipes(RecipeAPI.registerCrushers.getRecipeList(), DCsJEIPlugin.CRUSHER_UID);
12 | }
13 |
14 | }
15 |
--------------------------------------------------------------------------------
/main/java/defeatedcrow/hac/api/cultivate/package-info.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) defeatedcrow, 2016
3 | * URL:http://defeatedcrow.jp/modwiki/Mainpage
4 | * Please check the License.txt included in the package file of this Mod.
5 | */
6 |
7 | /**
8 | * このAPIは、気候を利用した農作物・植物を扱うAPIです。
9 | */
10 | @API(apiVersion = "3.4.0", owner = "dcs_lib", provides = "DCsHaCAPI|cultivate")
11 | package defeatedcrow.hac.api.cultivate;
12 |
13 | import net.minecraftforge.fml.common.API;
14 |
--------------------------------------------------------------------------------
/main/java/defeatedcrow/hac/core/plugin/jei/ReactorRecipeMaker.java:
--------------------------------------------------------------------------------
1 | package defeatedcrow.hac.core.plugin.jei;
2 |
3 | import defeatedcrow.hac.api.recipe.RecipeAPI;
4 | import mezz.jei.api.IModRegistry;
5 |
6 | public final class ReactorRecipeMaker {
7 |
8 | private ReactorRecipeMaker() {}
9 |
10 | public static void register(IModRegistry registry) {
11 | registry.addRecipes(RecipeAPI.registerReactorRecipes.getRecipeList(), DCsJEIPlugin.REACTOR_UID);
12 | }
13 |
14 | }
15 |
--------------------------------------------------------------------------------
/main/java/defeatedcrow/hac/core/plugin/jei/SpinningRecipeMaker.java:
--------------------------------------------------------------------------------
1 | package defeatedcrow.hac.core.plugin.jei;
2 |
3 | import defeatedcrow.hac.api.recipe.RecipeAPI;
4 | import mezz.jei.api.IModRegistry;
5 |
6 | public final class SpinningRecipeMaker {
7 |
8 | private SpinningRecipeMaker() {}
9 |
10 | public static void register(IModRegistry registry) {
11 | registry.addRecipes(RecipeAPI.registerSpinningRecipes.getRecipeList(), DCsJEIPlugin.SPINNING_UID);
12 | }
13 |
14 | }
15 |
--------------------------------------------------------------------------------
/main/java/defeatedcrow/hac/api/blockstate/package-info.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) defeatedcrow, 2016
3 | * URL:http://defeatedcrow.jp/modwiki/Mainpage
4 | * Please check the License.txt included in the package file of this Mod.
5 | */
6 |
7 | /**
8 | * 当MODのBlockに含まれているBlockStateへのアクセス用APIです。
9 | */
10 | @API(apiVersion = "3.4.0", owner = "dcs_lib", provides = "DCsHaCAPI|blockstate")
11 | package defeatedcrow.hac.api.blockstate;
12 |
13 | import net.minecraftforge.fml.common.API;
14 |
--------------------------------------------------------------------------------
/main/java/defeatedcrow/hac/api/item/IPlatingTool.java:
--------------------------------------------------------------------------------
1 | package defeatedcrow.hac.api.item;
2 |
3 | import net.minecraft.enchantment.Enchantment;
4 | import net.minecraft.item.ItemStack;
5 |
6 | /**
7 | * めっきツール
8 | * 金床で使用すると、対象のアイテムにエンチャントを付与します。
9 | */
10 | public interface IPlatingTool {
11 |
12 | Enchantment[] getEnchantments(int meta);
13 |
14 | boolean canEnchant(ItemStack target, ItemStack tool);
15 |
16 | ItemStack getEnchantedItem(ItemStack target, ItemStack tool);
17 |
18 | }
19 |
--------------------------------------------------------------------------------
/main/java/defeatedcrow/hac/api/magic/package-info.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) defeatedcrow, 2016
3 | * URL:http://defeatedcrow.jp/modwiki/Mainpage
4 | * Please check the License.txt included in the package file of this Mod.
5 | */
6 |
7 | /**
8 | * 宝石アクセサリーなどの魔法効果を扱うAPIです。
9 | * 判定用インターフェイスや、効果の発動に干渉するEventを含みます。
10 | */
11 | @API(apiVersion = "3.8.1", owner = "dcs_lib", provides = "DCsHaCAPI|magic")
12 | package defeatedcrow.hac.api.magic;
13 |
14 | import net.minecraftforge.fml.common.API;
15 |
--------------------------------------------------------------------------------
/main/java/defeatedcrow/hac/core/plugin/jei/ShapelessNBTWrapper.java:
--------------------------------------------------------------------------------
1 | package defeatedcrow.hac.core.plugin.jei;
2 |
3 | import defeatedcrow.hac.core.recipe.ShapelessNBTRecipe;
4 | import mezz.jei.api.IJeiHelpers;
5 | import mezz.jei.plugins.vanilla.crafting.ShapelessRecipeWrapper;
6 |
7 | public class ShapelessNBTWrapper extends ShapelessRecipeWrapper {
8 |
9 | public ShapelessNBTWrapper(IJeiHelpers jeiHelpers, ShapelessNBTRecipe recipe) {
10 | super(jeiHelpers, recipe);
11 | }
12 |
13 | }
14 |
--------------------------------------------------------------------------------
/main/resources/assets/dcs_climate/recipes/core/dcs_flint_and_steel_0.json:
--------------------------------------------------------------------------------
1 | {
2 | "type": "forge:ore_shapeless",
3 | "ingredients": [
4 | {
5 | "item": "minecraft:iron_ingot",
6 | "data": 0
7 | },
8 | {
9 | "type": "forge:ore_dict",
10 | "ore": "gemChalcedony"
11 | }
12 | ],
13 | "result": {
14 | "item": "minecraft:flint_and_steel",
15 | "count": 1,
16 | "data": 0
17 | },
18 | "conditions": [
19 | {
20 | "type": "dcs_climate:recipe_enabled",
21 | "module": "core"
22 | }
23 | ]
24 | }
--------------------------------------------------------------------------------
/main/java/defeatedcrow/hac/api/recipe/package-info.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) defeatedcrow, 2016
3 | * URL:http://defeatedcrow.jp/modwiki/Mainpage
4 | * Please check the License.txt included in the package file of this Mod.
5 | */
6 |
7 | /**
8 | * このAPIは、Climateを利用したレシピの登録・管理用APIです。
9 | * 設置状態での変化と、Inventory内で進行するレシピで共通です。
10 | */
11 | @API(apiVersion = "3.4.0", owner = "dcs_lib", provides = "DCsHaCAPI|recipe")
12 | package defeatedcrow.hac.api.recipe;
13 |
14 | import net.minecraftforge.fml.common.API;
15 |
--------------------------------------------------------------------------------
/main/java/defeatedcrow/hac/api/placeable/package-info.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) defeatedcrow, 2016
3 | * URL:http://defeatedcrow.jp/modwiki/Mainpage
4 | * Please check the License.txt included in the package file of this Mod.
5 | */
6 |
7 | /**
8 | * このAPIは、BlockやEntityなどの設置物を扱います。
9 | * かつてAMT2にあった、設置可能な食べ物についてもここで定義しています。
10 | */
11 | @API(apiVersion = "3.4.0", owner = "dcs_lib", provides = "DCsHaCAPI|placeable")
12 | package defeatedcrow.hac.api.placeable;
13 |
14 | import net.minecraftforge.fml.common.API;
15 |
--------------------------------------------------------------------------------
/main/resources/assets/dcs_climate/recipes/core/dcs_cookie_0.json:
--------------------------------------------------------------------------------
1 | {
2 | "type": "forge:ore_shaped",
3 | "pattern": [
4 | "YZY"
5 | ],
6 | "key": {
7 | "Y": {
8 | "type": "forge:ore_dict",
9 | "ore": "foodFlour"
10 | },
11 | "Z": {
12 | "type": "forge:ore_dict",
13 | "ore": "cropCocoa"
14 | }
15 | },
16 | "result": {
17 | "item": "minecraft:cookie",
18 | "count": 8,
19 | "data": 0
20 | },
21 | "conditions": [
22 | {
23 | "type": "dcs_climate:recipe_enabled",
24 | "module": "core"
25 | }
26 | ]
27 | }
--------------------------------------------------------------------------------
/main/java/defeatedcrow/hac/api/climate/IClimate.java:
--------------------------------------------------------------------------------
1 | package defeatedcrow.hac.api.climate;
2 |
3 | /**
4 | * このMODでは、気候の要素(温度、湿度、通気)をClimateとしてセットで扱う。
5 | * また、通気、湿度、温度をintに変換して0bAABBCCCという形にもできるため、int型でNBTなどに持たせておくことが出来る。
6 | */
7 | public interface IClimate {
8 |
9 | DCHeatTier getHeat();
10 |
11 | DCHumidity getHumidity();
12 |
13 | DCAirflow getAirflow();
14 |
15 | int getClimateInt();
16 |
17 | IClimate addTempTier(int tier);
18 |
19 | IClimate addHumTier(int tier);
20 |
21 | IClimate addAirTier(int tier);
22 |
23 | }
24 |
--------------------------------------------------------------------------------
/main/resources/assets/dcs_climate/recipes/core/dcs_bed_0.json:
--------------------------------------------------------------------------------
1 | {
2 | "type": "forge:ore_shaped",
3 | "pattern": [
4 | "XXX",
5 | "YYY"
6 | ],
7 | "key": {
8 | "X": {
9 | "type": "forge:ore_dict",
10 | "ore": "itemCloth"
11 | },
12 | "Y": {
13 | "type": "forge:ore_dict",
14 | "ore": "plankWood"
15 | }
16 | },
17 | "result": {
18 | "item": "minecraft:bed",
19 | "count": 1,
20 | "data": 0
21 | },
22 | "conditions": [
23 | {
24 | "type": "dcs_climate:recipe_enabled",
25 | "module": "core"
26 | }
27 | ]
28 | }
--------------------------------------------------------------------------------
/main/resources/mcmod.info:
--------------------------------------------------------------------------------
1 | [
2 | {
3 | "description":"",
4 | "parent":"",
5 | "logoFile":"",
6 | "credits":"defeatedcrow",
7 | "dependencies":[],
8 | "modid":"dcs_lib",
9 | "mcversion":"1.12.2",
10 | "screenshots":[],
11 | "authorList":[
12 | "defeatedcrow"
13 | ],
14 | "name":"HeatAndClimateLib",
15 | "url":"http://defeatedcrow.jp/modwiki/HeatAndClimate",
16 | "updateUrl":"",
17 | "version":"3.9.3",
18 | "requiredMods":[
19 | "Minecraft Forge1.12.2-14.23.5.2847+"
20 | ]
21 | }
22 | ]
--------------------------------------------------------------------------------
/main/resources/assets/dcs_climate/recipes/core/dcs_compass_0.json:
--------------------------------------------------------------------------------
1 | {
2 | "type": "forge:ore_shaped",
3 | "pattern": [
4 | " X ",
5 | "XYX",
6 | " X "
7 | ],
8 | "key": {
9 | "X": {
10 | "type": "forge:ore_dict",
11 | "ore": "ingotIron"
12 | },
13 | "Y": {
14 | "type": "forge:ore_dict",
15 | "ore": "dustMagnetite"
16 | }
17 | },
18 | "result": {
19 | "item": "minecraft:compass",
20 | "count": 1,
21 | "data": 0
22 | },
23 | "conditions": [
24 | {
25 | "type": "dcs_climate:recipe_enabled",
26 | "module": "core"
27 | }
28 | ]
29 | }
--------------------------------------------------------------------------------
/main/resources/assets/dcs_climate/recipes/core/dcs_painting_0.json:
--------------------------------------------------------------------------------
1 | {
2 | "type": "forge:ore_shaped",
3 | "pattern": [
4 | "XXX",
5 | "XYX",
6 | "XXX"
7 | ],
8 | "key": {
9 | "X": {
10 | "type": "forge:ore_dict",
11 | "ore": "stickWood"
12 | },
13 | "Y": {
14 | "type": "forge:ore_dict",
15 | "ore": "itemCloth"
16 | }
17 | },
18 | "result": {
19 | "item": "minecraft:painting",
20 | "count": 1,
21 | "data": 0
22 | },
23 | "conditions": [
24 | {
25 | "type": "dcs_climate:recipe_enabled",
26 | "module": "core"
27 | }
28 | ]
29 | }
--------------------------------------------------------------------------------
/main/java/defeatedcrow/hac/api/climate/IThermalInsulationBlock.java:
--------------------------------------------------------------------------------
1 | package defeatedcrow.hac.api.climate;
2 |
3 | import net.minecraft.block.state.IBlockState;
4 | import net.minecraft.util.math.BlockPos;
5 | import net.minecraft.world.World;
6 |
7 | /**
8 | * Reduce Tier of HeatTier if it's between target and heat source block.
9 | */
10 | public interface IThermalInsulationBlock {
11 |
12 | /*
13 | * -1: prevent all
14 | * 0: no prevention
15 | * 1~ : reduce amount
16 | */
17 | int getReductionAmount(World world, BlockPos pos, IBlockState state);
18 |
19 | }
20 |
--------------------------------------------------------------------------------
/main/java/defeatedcrow/hac/core/plugin/jei/ClimateBiomeMaker.java:
--------------------------------------------------------------------------------
1 | package defeatedcrow.hac.core.plugin.jei;
2 |
3 | import java.util.List;
4 |
5 | import com.google.common.collect.Lists;
6 |
7 | import mezz.jei.api.IModRegistry;
8 | import net.minecraft.world.biome.Biome;
9 |
10 | public final class ClimateBiomeMaker {
11 |
12 | private ClimateBiomeMaker() {}
13 |
14 | public static void register(IModRegistry registry) {
15 | List biomes = Lists.newArrayList(Biome.REGISTRY.iterator());
16 | registry.addRecipes(biomes, DCsJEIPlugin.BIOME_UID);
17 | }
18 |
19 | }
20 |
--------------------------------------------------------------------------------
/main/java/defeatedcrow/hac/api/damage/IArmorItemRegister.java:
--------------------------------------------------------------------------------
1 | package defeatedcrow.hac.api.damage;
2 |
3 | import java.util.HashMap;
4 |
5 | import defeatedcrow.hac.api.climate.ItemSet;
6 | import net.minecraft.item.ItemStack;
7 |
8 | /**
9 | * 気候ダメージへの耐性を防具Itemごとに登録
10 | */
11 | public interface IArmorItemRegister {
12 |
13 | HashMap getHeatMap();
14 |
15 | HashMap getColdMap();
16 |
17 | void registerMaterial(ItemStack item, float heat, float cold);
18 |
19 | float getHeatPreventAmount(ItemStack item);
20 |
21 | float getColdPreventAmount(ItemStack item);
22 |
23 | }
24 |
--------------------------------------------------------------------------------
/main/java/defeatedcrow/hac/core/util/RecipeResources.java:
--------------------------------------------------------------------------------
1 | package defeatedcrow.hac.core.util;
2 |
3 | import defeatedcrow.hac.core.ClimateCore;
4 | import net.minecraft.util.ResourceLocation;
5 |
6 | public class RecipeResources {
7 |
8 | private final String domein;
9 | private int count = 0;
10 |
11 | public RecipeResources(String d) {
12 | domein = d;
13 | }
14 |
15 | public static final RecipeResources CORE = new RecipeResources("core");
16 |
17 | public ResourceLocation getRecipeName() {
18 | count++;
19 | return new ResourceLocation(ClimateCore.MOD_ID, domein + "_" + count);
20 | }
21 |
22 | }
23 |
--------------------------------------------------------------------------------
/main/java/defeatedcrow/hac/api/climate/IClimateTileEntity.java:
--------------------------------------------------------------------------------
1 | package defeatedcrow.hac.api.climate;
2 |
3 | import net.minecraft.util.math.BlockPos;
4 |
5 | /**
6 | * TileEntityに実装するもの。
7 | * BlockPosや内部の状況によって発生するClimateが細かく変化する。
8 | * ターゲットがClimateReceiveTileの場合は任意のタイミングでPos登録することで通常の走査エリア外から干渉できる。
9 | * ちなみにCalculatorはこれを走査しない。そのためBlock側にもIHeatTile等Block用インターフェイスを別途で実装する。
10 | */
11 | public interface IClimateTileEntity {
12 |
13 | DCHeatTier getHeatTier(BlockPos target);
14 |
15 | DCHumidity getHumidity(BlockPos target);
16 |
17 | DCAirflow getAirflow(BlockPos target);
18 |
19 | boolean isActive();
20 | }
21 |
--------------------------------------------------------------------------------
/main/java/defeatedcrow/hac/api/recipe/RecipeAPI.java:
--------------------------------------------------------------------------------
1 | package defeatedcrow.hac.api.recipe;
2 |
3 | /**
4 | * レシピの登録や参照はここから行って下さい
5 | */
6 | public class RecipeAPI {
7 |
8 | private RecipeAPI() {}
9 |
10 | public static boolean isLoaded;
11 |
12 | public static IClimateSmeltingRegister registerSmelting;
13 |
14 | public static IMillRecipeRegister registerMills;
15 | public static IFluidRecipeRegister registerFluidRecipes;
16 | public static IReactorRecipeRegister registerReactorRecipes;
17 | public static ISpinningRecipeRegister registerSpinningRecipes;
18 | public static ICrusherRecipeRegister registerCrushers;
19 | }
20 |
--------------------------------------------------------------------------------
/main/java/defeatedcrow/hac/api/energy/capability/package-info.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) defeatedcrow, 2016
3 | * URL:http://defeatedcrow.jp/modwiki/Mainpage
4 | * defeatedcrow's mods are distributed under the terms of the Minecraft Mod Public License 1.0, or MMPL.
5 | * Please check the License(MMPL_1.0).txt included in the package file of this Mod.
6 | */
7 |
8 | /**
9 | * このAPIは、このmodで扱われるエネルギーをCapabilityシステムで扱うためのAPIです。
10 | * 。
11 | */
12 | @API(apiVersion = "2.3.0", owner = "dcs_lib", provides = "DCsHaCAPI|capability")
13 | package defeatedcrow.hac.api.energy.capability;
14 |
15 | import net.minecraftforge.fml.common.API;
--------------------------------------------------------------------------------
/main/resources/assets/dcs_climate/recipes/core/dcs_saddle_0.json:
--------------------------------------------------------------------------------
1 | {
2 | "type": "forge:ore_shaped",
3 | "pattern": [
4 | "X",
5 | "Y",
6 | "Z"
7 | ],
8 | "key": {
9 | "X": {
10 | "type": "forge:ore_dict",
11 | "ore": "leather"
12 | },
13 | "Y": {
14 | "type": "forge:ore_dict",
15 | "ore": "itemCloth"
16 | },
17 | "Z": {
18 | "type": "forge:ore_dict",
19 | "ore": "ingotIron"
20 | }
21 | },
22 | "result": {
23 | "item": "minecraft:saddle",
24 | "count": 1,
25 | "data": 0
26 | },
27 | "conditions": [
28 | {
29 | "type": "dcs_climate:recipe_enabled",
30 | "module": "core"
31 | }
32 | ]
33 | }
--------------------------------------------------------------------------------
/main/java/defeatedcrow/hac/api/energy/package-info.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) defeatedcrow, 2016
3 | * URL:http://defeatedcrow.jp/modwiki/Mainpage
4 | * Please check the License.txt included in the package file of this Mod.
5 | */
6 |
7 | /**
8 | * このAPIは、このmodで扱われるエネルギーに関するAPIです。
9 | * 現在は他のmodのエネルギーとの互換性はありません。
10 | * 基本はトルク(Torque)の形でエネルギーを伝えます。必要に応じて回転力やピストン動力に変換されます。
11 | * インターフェイスでは加速度(acceleration)にしか干渉できません。スピードは、加速度に応じて常に変動します。
12 | */
13 | @API(apiVersion = "3.4.0", owner = "dcs_lib", provides = "DCsHaCAPI|energy")
14 | package defeatedcrow.hac.api.energy;
15 |
16 | import net.minecraftforge.fml.common.API;
17 |
--------------------------------------------------------------------------------
/main/java/defeatedcrow/hac/core/plugin/jei/ClimateSmeltingMaker.java:
--------------------------------------------------------------------------------
1 | package defeatedcrow.hac.core.plugin.jei;
2 |
3 | import java.util.ArrayList;
4 | import java.util.List;
5 |
6 | import defeatedcrow.hac.api.climate.DCHeatTier;
7 | import defeatedcrow.hac.api.recipe.RecipeAPI;
8 | import defeatedcrow.hac.core.climate.recipe.ClimateSmelting;
9 | import mezz.jei.api.IModRegistry;
10 |
11 | public final class ClimateSmeltingMaker {
12 |
13 | private ClimateSmeltingMaker() {}
14 |
15 | public static void register(IModRegistry registry) {
16 | registry.addRecipes(RecipeAPI.registerSmelting.getRecipeList(), DCsJEIPlugin.SMELTING_UID);
17 | }
18 |
19 | }
20 |
--------------------------------------------------------------------------------
/main/java/defeatedcrow/hac/core/plugin/main/MainComHelper.java:
--------------------------------------------------------------------------------
1 | package defeatedcrow.hac.core.plugin.main;
2 |
3 | import java.io.File;
4 |
5 | import defeatedcrow.hac.config.ClimateConfig;
6 | import defeatedcrow.hac.core.ClimateCore;
7 | import defeatedcrow.hac.main.config.MainConfig;
8 |
9 | public class MainComHelper {
10 |
11 | public static boolean reloadMainConfig() {
12 | if (!ClimateCore.loadedMain)
13 | return false;
14 |
15 | File dir = new File(ClimateConfig.configDir, "main.cfg");
16 | if (dir.exists()) {
17 | MainConfig.INSTANCE.load(ClimateConfig.configDir);
18 | return true;
19 | }
20 | return false;
21 | }
22 |
23 | }
24 |
--------------------------------------------------------------------------------
/main/java/defeatedcrow/hac/api/placeable/IEntityItem.java:
--------------------------------------------------------------------------------
1 | package defeatedcrow.hac.api.placeable;
2 |
3 | import net.minecraft.entity.Entity;
4 | import net.minecraft.entity.player.EntityPlayer;
5 | import net.minecraft.item.ItemStack;
6 | import net.minecraft.util.math.BlockPos;
7 | import net.minecraft.world.World;
8 |
9 | /**
10 | * EntityとItemを紐付けるインターフェイス。
11 | */
12 | public interface IEntityItem {
13 |
14 | boolean canSpawnHere(World world, BlockPos pos);
15 |
16 | boolean spawnPlacementEntity(World world, Entity entity);
17 |
18 | Entity getPlacementEntity(World world, EntityPlayer player, double x, double y, double z, ItemStack item);
19 |
20 | }
21 |
--------------------------------------------------------------------------------
/main/java/defeatedcrow/hac/core/energy/ISidedEnergyStorage.java:
--------------------------------------------------------------------------------
1 | package defeatedcrow.hac.core.energy;
2 |
3 | import net.minecraft.util.EnumFacing;
4 | import net.minecraftforge.energy.IEnergyStorage;
5 |
6 | /**
7 | * sided energy interface for FU
8 | */
9 | public interface ISidedEnergyStorage extends IEnergyStorage {
10 |
11 | int receiveEnergy(int maxReceive, boolean simulate, EnumFacing face);
12 |
13 | int extractEnergy(int maxExtract, boolean simulate, EnumFacing face);
14 |
15 | boolean canExtract(EnumFacing face);
16 |
17 | boolean canReceive(EnumFacing face);
18 |
19 | boolean[] extractSide();
20 |
21 | boolean[] receiveSide();
22 |
23 | }
24 |
--------------------------------------------------------------------------------
/main/java/defeatedcrow/hac/core/plugin/jei/ClimateCropMaker.java:
--------------------------------------------------------------------------------
1 | package defeatedcrow.hac.core.plugin.jei;
2 |
3 | import java.util.ArrayList;
4 | import java.util.List;
5 |
6 | import defeatedcrow.hac.api.cultivate.CropAPI;
7 | import defeatedcrow.hac.api.cultivate.IClimateCrop;
8 | import mezz.jei.api.IModRegistry;
9 |
10 | public final class ClimateCropMaker {
11 |
12 | private ClimateCropMaker() {}
13 |
14 | public static void register(IModRegistry registry) {
15 | List list = new ArrayList();
16 | list.addAll(CropAPI.register.getList().values());
17 | registry.addRecipes(list, DCsJEIPlugin.CROP_UID);
18 | }
19 |
20 | }
21 |
--------------------------------------------------------------------------------
/main/java/defeatedcrow/hac/api/climate/IClimateHelper.java:
--------------------------------------------------------------------------------
1 | package defeatedcrow.hac.api.climate;
2 |
3 | import net.minecraft.nbt.NBTTagCompound;
4 |
5 | public interface IClimateHelper {
6 |
7 | /**
8 | * climateを0bAABBCCCのintとして表現したものと互換性を持たせる。
9 | * NBT用。
10 | */
11 | IClimate getClimateFromInt(int i);
12 |
13 | IClimate getClimateFromParam(DCHeatTier heat, DCHumidity hum, DCAirflow air);
14 |
15 | /**
16 | * NBTからIClimateに。
17 | */
18 | IClimate getClimateFromNBT(NBTTagCompound nbt);
19 |
20 | /**
21 | * NBTにIClimateをセット。
22 | */
23 | void setClimateToNBT(NBTTagCompound nbt, IClimate climate);
24 |
25 | String getNBTKey();
26 |
27 | }
28 |
--------------------------------------------------------------------------------
/main/java/defeatedcrow/hac/core/packet/MessageCharmKey.java:
--------------------------------------------------------------------------------
1 | package defeatedcrow.hac.core.packet;
2 |
3 | import io.netty.buffer.ByteBuf;
4 | import net.minecraftforge.fml.common.network.simpleimpl.IMessage;
5 |
6 | // チャームのキー押下判定
7 | public class MessageCharmKey implements IMessage {
8 |
9 | public byte data;
10 |
11 | public MessageCharmKey() {
12 | }
13 |
14 | public MessageCharmKey(byte par1) {
15 | this.data = par1;
16 | }
17 |
18 | // read
19 | @Override
20 | public void fromBytes(ByteBuf buf) {
21 | this.data = buf.readByte();
22 | }
23 |
24 | // write
25 | @Override
26 | public void toBytes(ByteBuf buf) {
27 | buf.writeByte(this.data);
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/main/java/defeatedcrow/hac/core/packet/command/MessageComConfig.java:
--------------------------------------------------------------------------------
1 | package defeatedcrow.hac.core.packet.command;
2 |
3 | import io.netty.buffer.ByteBuf;
4 | import net.minecraftforge.fml.common.network.simpleimpl.IMessage;
5 |
6 | // season
7 | public class MessageComConfig implements IMessage {
8 |
9 | public byte data;
10 |
11 | public MessageComConfig() {}
12 |
13 | public MessageComConfig(byte par1) {
14 | this.data = par1;
15 | }
16 |
17 | // read
18 | @Override
19 | public void fromBytes(ByteBuf buf) {
20 | this.data = buf.readByte();
21 | }
22 |
23 | // write
24 | @Override
25 | public void toBytes(ByteBuf buf) {
26 | buf.writeByte(this.data);
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/main/java/defeatedcrow/hac/core/packet/command/MessageComSeason.java:
--------------------------------------------------------------------------------
1 | package defeatedcrow.hac.core.packet.command;
2 |
3 | import io.netty.buffer.ByteBuf;
4 | import net.minecraftforge.fml.common.network.simpleimpl.IMessage;
5 |
6 | // season
7 | public class MessageComSeason implements IMessage {
8 |
9 | public byte data;
10 |
11 | public MessageComSeason() {}
12 |
13 | public MessageComSeason(byte par1) {
14 | this.data = par1;
15 | }
16 |
17 | // read
18 | @Override
19 | public void fromBytes(ByteBuf buf) {
20 | this.data = buf.readByte();
21 | }
22 |
23 | // write
24 | @Override
25 | public void toBytes(ByteBuf buf) {
26 | buf.writeByte(this.data);
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/main/java/defeatedcrow/hac/api/climate/package-info.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) defeatedcrow, 2016
3 | * URL:http://defeatedcrow.jp/modwiki/Mainpage
4 | * Please check the License.txt included in the package file of this Mod.
5 | */
6 |
7 | /**
8 | * このAPIは、World上の座標(BlockPos)の持つ気候要因を扱うものです。
9 | * HeatTier(温度)、Humidity(湿度)、Airflow(通気)の要因があり、Biomeや周辺のBlockによって決まります。
10 | *
11 | * BiomeやBlockを追加したい場合はDCsClimateAPI.register、
12 | * 座標のClimateを確認したい場合はDCsClimateAPI.calculatorを使用して下さい。
13 | */
14 | @API(apiVersion = "3.8.3", owner = "dcs_lib", provides = "DCsHaCAPI|climate")
15 | package defeatedcrow.hac.api.climate;
16 |
17 | import net.minecraftforge.fml.common.API;
18 |
--------------------------------------------------------------------------------
/main/java/defeatedcrow/hac/core/packet/command/MessageComDrought.java:
--------------------------------------------------------------------------------
1 | package defeatedcrow.hac.core.packet.command;
2 |
3 | import io.netty.buffer.ByteBuf;
4 | import net.minecraftforge.fml.common.network.simpleimpl.IMessage;
5 |
6 | // season
7 | public class MessageComDrought implements IMessage {
8 |
9 | public byte data;
10 |
11 | public MessageComDrought() {}
12 |
13 | public MessageComDrought(byte par1) {
14 | this.data = par1;
15 | }
16 |
17 | // read
18 | @Override
19 | public void fromBytes(ByteBuf buf) {
20 | this.data = buf.readByte();
21 | }
22 |
23 | // write
24 | @Override
25 | public void toBytes(ByteBuf buf) {
26 | buf.writeByte(this.data);
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/main/java/defeatedcrow/hac/api/recipe/ISpinningRecipe.java:
--------------------------------------------------------------------------------
1 | package defeatedcrow.hac.api.recipe;
2 |
3 | import java.util.List;
4 |
5 | import net.minecraft.item.ItemStack;
6 |
7 | /**
8 | * Climate不要の臼引きの1:1交換レシピ。
9 | * 材料は辞書対応。
10 | */
11 | public interface ISpinningRecipe {
12 |
13 | /**
14 | * Input登録内容
15 | */
16 | Object getInput();
17 |
18 | int getInputCount();
19 |
20 | ItemStack getOutput();
21 |
22 | /**
23 | * macth条件判定用、鉱石辞書変換後のInputリスト
24 | */
25 | List getProcessedInput();
26 |
27 | /**
28 | * Input条件判定
29 | */
30 | boolean matchInput(ItemStack item);
31 |
32 | /**
33 | * Input条件判定
34 | */
35 | boolean matchOutput(ItemStack target);
36 | }
37 |
--------------------------------------------------------------------------------
/main/java/defeatedcrow/hac/core/packet/command/ForcedSeason.java:
--------------------------------------------------------------------------------
1 | package defeatedcrow.hac.core.packet.command;
2 |
3 | import defeatedcrow.hac.api.climate.EnumSeason;
4 |
5 | public class ForcedSeason implements IForcedSeason {
6 |
7 | public EnumSeason forced = EnumSeason.SPRING;
8 | public boolean isForced = false;
9 |
10 | @Override
11 | public EnumSeason getSeason() {
12 | return forced;
13 | }
14 |
15 | @Override
16 | public void setForcedSeason(EnumSeason season) {
17 | forced = season;
18 | }
19 |
20 | @Override
21 | public boolean isForced() {
22 | return isForced;
23 | }
24 |
25 | @Override
26 | public void setForced(boolean b) {
27 | isForced = b;
28 | }
29 |
30 | }
31 |
--------------------------------------------------------------------------------
/main/java/defeatedcrow/hac/api/magic/IMagicCost.java:
--------------------------------------------------------------------------------
1 | package defeatedcrow.hac.api.magic;
2 |
3 | import net.minecraft.entity.player.EntityPlayer;
4 | import net.minecraft.item.ItemStack;
5 |
6 | public abstract interface IMagicCost {
7 |
8 | /**
9 | * Called before cost-consumable check.
10 | * If false, the use of magic will be cancelled.
11 | */
12 | boolean canUseMagic(EntityPlayer player, ItemStack stack);
13 |
14 | /**
15 | * Called before cost consumption.
16 | * If false, cost consumption will be cancelled. (The activation of magic is not affected.)
17 | */
18 | boolean beforeConsumption(EntityPlayer player, ItemStack stack);
19 |
20 | float getCost(ItemStack item);
21 |
22 | }
23 |
--------------------------------------------------------------------------------
/main/java/defeatedcrow/hac/core/client/DCTextures.java:
--------------------------------------------------------------------------------
1 | package defeatedcrow.hac.core.client;
2 |
3 | import net.minecraft.util.ResourceLocation;
4 |
5 | public enum DCTextures {
6 | POTION("textures/blocks/gray_effect.png"),
7 | HUD("textures/gui/hud_climate.png"),
8 | GRAY("textures/blocks/gray_effect.png"),
9 | HOT_DISP("textures/gui/hud_hot.png"),
10 | COLD_DISP("textures/gui/hud_cold.png");
11 |
12 | private final String name;
13 |
14 | private DCTextures(String nameIn) {
15 | name = nameIn;
16 | }
17 |
18 | public String getName() {
19 | return name;
20 | }
21 |
22 | public ResourceLocation getRocation() {
23 | return new ResourceLocation("dcs_climate", name);
24 | }
25 |
26 | }
27 |
--------------------------------------------------------------------------------
/main/java/defeatedcrow/hac/core/client/base/DCFoodModelBase.java:
--------------------------------------------------------------------------------
1 | package defeatedcrow.hac.core.client.base;
2 |
3 | import defeatedcrow.hac.core.base.FoodEntityBase;
4 | import net.minecraft.client.model.ModelBase;
5 | import net.minecraftforge.fml.relauncher.Side;
6 | import net.minecraftforge.fml.relauncher.SideOnly;
7 |
8 | @SideOnly(Side.CLIENT)
9 | public abstract class DCFoodModelBase extends ModelBase {
10 |
11 | private final boolean isBaked;
12 |
13 | public DCFoodModelBase(boolean baked) {
14 | super();
15 | isBaked = baked;
16 | }
17 |
18 | public abstract void render(float scale, FoodEntityBase entity);
19 |
20 | public boolean isBaked() {
21 | return isBaked;
22 | }
23 |
24 | }
25 |
--------------------------------------------------------------------------------
/main/resources/assets/dcs_climate/recipes/core/dcs_cake_0.json:
--------------------------------------------------------------------------------
1 | {
2 | "type": "forge:ore_shaped",
3 | "pattern": [
4 | "XXX",
5 | "YZY",
6 | "WWW"
7 | ],
8 | "key": {
9 | "X": {
10 | "type": "forge:ore_dict",
11 | "ore": "bucketMilk"
12 | },
13 | "Y": {
14 | "type": "forge:ore_dict",
15 | "ore": "dustSugar"
16 | },
17 | "Z": {
18 | "type": "forge:ore_dict",
19 | "ore": "egg"
20 | },
21 | "W": {
22 | "type": "forge:ore_dict",
23 | "ore": "foodFlour"
24 | }
25 | },
26 | "result": {
27 | "item": "minecraft:cake",
28 | "count": 1,
29 | "data": 0
30 | },
31 | "conditions": [
32 | {
33 | "type": "dcs_climate:recipe_enabled",
34 | "module": "core"
35 | }
36 | ]
37 | }
--------------------------------------------------------------------------------
/main/java/defeatedcrow/hac/api/climate/ClimateSupplier.java:
--------------------------------------------------------------------------------
1 | package defeatedcrow.hac.api.climate;
2 |
3 | import net.minecraft.util.math.BlockPos;
4 | import net.minecraft.world.World;
5 |
6 | import java.util.function.Supplier;
7 |
8 | public class ClimateSupplier implements Supplier {
9 | private IClimate cached;
10 | private World world;
11 | private BlockPos pos;
12 |
13 | public ClimateSupplier(World world, BlockPos pos) {
14 | this.world = world;
15 | this.pos = pos;
16 | }
17 |
18 | @Override
19 | public IClimate get() {
20 | if(cached == null)
21 | cached = ClimateAPI.calculator.getClimate(world, pos);
22 | return cached;
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/main/java/defeatedcrow/hac/asm/DCEventFactory.java:
--------------------------------------------------------------------------------
1 | package defeatedcrow.hac.asm;
2 |
3 | import java.util.Random;
4 |
5 | import defeatedcrow.hac.api.hook.DCBlockUpdateEvent;
6 | import net.minecraft.block.state.IBlockState;
7 | import net.minecraft.util.math.BlockPos;
8 | import net.minecraft.world.World;
9 | import net.minecraftforge.common.MinecraftForge;
10 |
11 | public class DCEventFactory {
12 |
13 | public static boolean onBlockUpdate(World worldIn, BlockPos pos, IBlockState state, Random rand) {
14 | DCBlockUpdateEvent event = new DCBlockUpdateEvent(worldIn, pos, state, rand);
15 | MinecraftForge.EVENT_BUS.post(event);
16 | if (event.isCanceled()) {
17 | return true;
18 | }
19 | return false;
20 | }
21 |
22 | }
23 |
--------------------------------------------------------------------------------
/main/java/defeatedcrow/hac/api/energy/ITorqueProvider.java:
--------------------------------------------------------------------------------
1 | package defeatedcrow.hac.api.energy;
2 |
3 | import java.util.List;
4 |
5 | import net.minecraft.util.EnumFacing;
6 | import net.minecraft.util.math.BlockPos;
7 | import net.minecraft.world.World;
8 |
9 | /**
10 | * トルクを発生するTileEntityに実装するもの
11 | * トルクマシンは、発生側のTileEntityが能動的に動くため、
12 | * 外部からこれを利用したトルク発生機を追加する場合は、隣接Tileへの伝達処理を自作して下さい。
13 | */
14 | public interface ITorqueProvider extends ITorqueDC {
15 |
16 | List getOutputSide();
17 |
18 | float getAmount();
19 |
20 | boolean canProvideTorque(World world, BlockPos outputPos, EnumFacing output);
21 |
22 | float provideTorque(World world, BlockPos outputPos, EnumFacing output, boolean sim);
23 |
24 | }
25 |
--------------------------------------------------------------------------------
/main/java/defeatedcrow/hac/core/plugin/jei/ShapedNBTWrapper.java:
--------------------------------------------------------------------------------
1 | package defeatedcrow.hac.core.plugin.jei;
2 |
3 | import defeatedcrow.hac.core.recipe.ShapedNBTRecipe;
4 | import mezz.jei.api.IJeiHelpers;
5 | import mezz.jei.api.recipe.wrapper.IShapedCraftingRecipeWrapper;
6 | import mezz.jei.plugins.vanilla.crafting.ShapelessRecipeWrapper;
7 |
8 | public class ShapedNBTWrapper extends ShapelessRecipeWrapper implements IShapedCraftingRecipeWrapper {
9 |
10 | public ShapedNBTWrapper(IJeiHelpers jeiHelpers, ShapedNBTRecipe recipe) {
11 | super(jeiHelpers, recipe);
12 | }
13 |
14 | @Override
15 | public int getWidth() {
16 | return recipe.getWidth();
17 | }
18 |
19 | @Override
20 | public int getHeight() {
21 | return recipe.getHeight();
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/main/resources/assets/dcs_climate/models/block/dcs_0.json:
--------------------------------------------------------------------------------
1 | {
2 | "parent": "block/block",
3 | "textures": {
4 | "particle": "#all"
5 | },
6 | "elements": [
7 | { "from": [ 0, 0, 0 ],
8 | "to": [ 0, 0, 0 ],
9 | "shade": true,
10 | "faces": {
11 | "down": { "texture": "#all", "cullface": "down" },
12 | "up": { "texture": "#all", "cullface": "up" },
13 | "north": { "texture": "#all", "cullface": "north" },
14 | "south": { "texture": "#all", "cullface": "south" },
15 | "west": { "texture": "#all", "cullface": "west" },
16 | "east": { "texture": "#all", "cullface": "east" }
17 | }
18 | }
19 | ]
20 | }
--------------------------------------------------------------------------------
/main/java/defeatedcrow/hac/core/event/ElytraFlyingDC.java:
--------------------------------------------------------------------------------
1 | package defeatedcrow.hac.core.event;
2 |
3 | import defeatedcrow.hac.api.hook.DCElytraFlyingEvent;
4 | import defeatedcrow.hac.main.MainInit;
5 | import net.minecraft.entity.player.EntityPlayer;
6 | import net.minecraftforge.fml.common.eventhandler.Event.Result;
7 | import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
8 |
9 | public class ElytraFlyingDC {
10 |
11 | @SubscribeEvent
12 | public void onElytraCheck(DCElytraFlyingEvent event) {
13 | if (event.living instanceof EntityPlayer && !event.living.getEntityWorld().isRemote) {
14 | if (event.living.isPotionActive(MainInit.bird) || event.living.isPotionActive(MainInit.warp)) {
15 | event.setResult(Result.ALLOW);
16 | }
17 | }
18 | }
19 |
20 | }
21 |
--------------------------------------------------------------------------------
/main/java/defeatedcrow/hac/api/hook/DCElytraFlyingEvent.java:
--------------------------------------------------------------------------------
1 | package defeatedcrow.hac.api.hook;
2 |
3 | import net.minecraft.entity.EntityLivingBase;
4 | import net.minecraftforge.common.MinecraftForge;
5 | import net.minecraftforge.fml.common.eventhandler.Event;
6 | import net.minecraftforge.fml.common.eventhandler.Event.HasResult;
7 |
8 | /**
9 | * asm挿入用の追加イベント
10 | */
11 | @HasResult
12 | public class DCElytraFlyingEvent extends Event {
13 |
14 | public final EntityLivingBase living;
15 |
16 | public DCElytraFlyingEvent(EntityLivingBase entity) {
17 | this.living = entity;
18 | }
19 |
20 | public boolean result() {
21 | MinecraftForge.EVENT_BUS.post(this);
22 | if (hasResult() && getResult() == Result.ALLOW) {
23 | return true;
24 | }
25 |
26 | return false;
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/main/java/defeatedcrow/hac/api/hook/DCEntityItemUpdateEvent.java:
--------------------------------------------------------------------------------
1 | package defeatedcrow.hac.api.hook;
2 |
3 | import net.minecraft.entity.item.EntityItem;
4 | import net.minecraftforge.common.MinecraftForge;
5 | import net.minecraftforge.fml.common.eventhandler.Event;
6 | import net.minecraftforge.fml.common.eventhandler.Event.HasResult;
7 |
8 | /**
9 | * asm挿入用の追加イベント
10 | */
11 | @HasResult
12 | public class DCEntityItemUpdateEvent extends Event {
13 |
14 | public final EntityItem entityItem;
15 |
16 | public DCEntityItemUpdateEvent(EntityItem entity) {
17 | this.entityItem = entity;
18 | }
19 |
20 | public boolean result() {
21 | MinecraftForge.EVENT_BUS.post(this);
22 | if (hasResult() && getResult() == Result.ALLOW) {
23 | return true;
24 | }
25 |
26 | return false;
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/main/java/defeatedcrow/hac/core/plugin/jei/ClimateBiomeHandler.java:
--------------------------------------------------------------------------------
1 | package defeatedcrow.hac.core.plugin.jei;
2 |
3 | import mezz.jei.api.recipe.IRecipeHandler;
4 | import mezz.jei.api.recipe.IRecipeWrapper;
5 | import net.minecraft.world.biome.Biome;
6 |
7 | @Deprecated
8 | public class ClimateBiomeHandler implements IRecipeHandler {
9 |
10 | @Override
11 | public Class getRecipeClass() {
12 | return Biome.class;
13 | }
14 |
15 | @Override
16 | public String getRecipeCategoryUid(Biome recipe) {
17 | return "dcs_climate.biome";
18 | }
19 |
20 | @Override
21 | public IRecipeWrapper getRecipeWrapper(Biome recipe) {
22 | return new ClimateBiomeWrapper(recipe);
23 | }
24 |
25 | @Override
26 | public boolean isRecipeValid(Biome recipe) {
27 | return recipe != null;
28 | }
29 |
30 | }
31 |
--------------------------------------------------------------------------------
/main/resources/assets/dcs_climate/models/block/dcs_cube.json:
--------------------------------------------------------------------------------
1 | {
2 | "parent": "block/block",
3 | "ambientocclusion": true,
4 | "textures": {
5 | "particle": "#top"
6 | },
7 | "elements": [
8 | { "from": [ 0, 0, 0 ],
9 | "to": [ 16, 16, 16 ],
10 | "shade": true,
11 | "faces": {
12 | "down": { "texture": "#down", "cullface": "down" },
13 | "up": { "texture": "#top", "cullface": "up" },
14 | "north": { "texture": "#north", "cullface": "north" },
15 | "south": { "texture": "#south", "cullface": "south" },
16 | "west": { "texture": "#west", "cullface": "west" },
17 | "east": { "texture": "#east", "cullface": "east" }
18 | }
19 | }
20 | ]
21 | }
--------------------------------------------------------------------------------
/main/resources/assets/dcs_climate/recipes/core/dcs_gunpowder_0.json:
--------------------------------------------------------------------------------
1 | {
2 | "type": "forge:ore_shapeless",
3 | "ingredients": [
4 | {
5 | "type": "forge:ore_dict",
6 | "ore": "dustGraphite"
7 | },
8 | {
9 | "type": "forge:ore_dict",
10 | "ore": "dustGraphite"
11 | },
12 | {
13 | "type": "forge:ore_dict",
14 | "ore": "dustGraphite"
15 | },
16 | {
17 | "type": "forge:ore_dict",
18 | "ore": "dustNiter"
19 | },
20 | {
21 | "type": "forge:ore_dict",
22 | "ore": "dustNiter"
23 | },
24 | {
25 | "type": "forge:ore_dict",
26 | "ore": "dustSulfur"
27 | }
28 | ],
29 | "result": {
30 | "item": "minecraft:gunpowder",
31 | "count": 4,
32 | "data": 0
33 | },
34 | "conditions": [
35 | {
36 | "type": "dcs_climate:recipe_enabled",
37 | "module": "core"
38 | }
39 | ]
40 | }
--------------------------------------------------------------------------------
/main/resources/assets/dcs_climate/models/block/dcs_cube_tb.json:
--------------------------------------------------------------------------------
1 | {
2 | "parent": "block/block",
3 | "ambientocclusion": true,
4 | "textures": {
5 | "particle": "dcs_climate:blocks/clear"
6 | },
7 | "elements": [
8 | { "from": [ 0, 0, 0 ],
9 | "to": [ 16, 16, 16 ],
10 | "shade": true,
11 | "faces": {
12 | "down": { "texture": "#down", "cullface": "down" },
13 | "up": { "texture": "#up", "cullface": "up" },
14 | "north": { "texture": "#side", "cullface": "north" },
15 | "south": { "texture": "#side", "cullface": "south" },
16 | "west": { "texture": "#side", "cullface": "west" },
17 | "east": { "texture": "#side", "cullface": "east" }
18 | }
19 | }
20 | ]
21 | }
--------------------------------------------------------------------------------
/main/java/defeatedcrow/hac/api/recipe/ISpinningRecipeRegister.java:
--------------------------------------------------------------------------------
1 | package defeatedcrow.hac.api.recipe;
2 |
3 | import java.util.List;
4 |
5 | import net.minecraft.item.ItemStack;
6 |
7 | public interface ISpinningRecipeRegister {
8 |
9 | /**
10 | * Recipeのリストを得る。
11 | */
12 | List getRecipeList();
13 |
14 | /**
15 | * Recipe登録
16 | *
17 | * @param output
18 | * : 完成品
19 | * @param count
20 | * : 必要個数
21 | * @param input
22 | * : 材料
23 | */
24 | void addRecipe(ItemStack output, int count, Object input);
25 |
26 | void addRecipe(ItemStack output, Object input);
27 |
28 | void addRecipe(ISpinningRecipe recipe);
29 |
30 | /**
31 | * inputs, Climateでレシピを判定
32 | */
33 | ISpinningRecipe getRecipe(ItemStack input);
34 |
35 | boolean removeRecipe(ItemStack input);
36 |
37 | }
38 |
--------------------------------------------------------------------------------
/main/java/defeatedcrow/hac/core/event/AttachCapabilityDC.java:
--------------------------------------------------------------------------------
1 | package defeatedcrow.hac.core.event;
2 |
3 | import defeatedcrow.hac.core.ClimateCore;
4 | import defeatedcrow.hac.core.packet.command.ForcedSeasonHandler;
5 | import net.minecraft.util.ResourceLocation;
6 | import net.minecraft.world.World;
7 | import net.minecraftforge.event.AttachCapabilitiesEvent;
8 | import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
9 |
10 | public class AttachCapabilityDC {
11 |
12 | @SubscribeEvent
13 | public void onAttachCapability(AttachCapabilitiesEvent event) {
14 | if (event.getObject() != null) {
15 | ResourceLocation reg = new ResourceLocation(ClimateCore.MOD_ID, "forced_season");
16 | if (!event.getCapabilities().containsKey(reg))
17 | event.addCapability(reg, new ForcedSeasonHandler(event.getObject()));
18 | }
19 | }
20 |
21 | }
22 |
--------------------------------------------------------------------------------
/main/java/defeatedcrow/hac/api/placeable/IRapidCollectables.java:
--------------------------------------------------------------------------------
1 | package defeatedcrow.hac.api.placeable;
2 |
3 | import javax.annotation.Nullable;
4 |
5 | import net.minecraft.block.state.IBlockState;
6 | import net.minecraft.entity.player.EntityPlayer;
7 | import net.minecraft.item.ItemStack;
8 | import net.minecraft.util.math.BlockPos;
9 | import net.minecraft.world.World;
10 |
11 | /**
12 | * 指定したツールで右クリックすると3x3x3の範囲採掘できるオブジェクトに実装するインターフェイス。
13 | * 主にコンテナブロックなど、回収に時間を掛ける必要がない装飾系ブロックに実装する。
14 | * また、右クリック収穫作物やEntityなどにも流用可能。
15 | */
16 | public interface IRapidCollectables {
17 |
18 | String getCollectableTool();
19 |
20 | boolean isCollectable(@Nullable ItemStack item);
21 |
22 | int getCollectArea(@Nullable ItemStack item);
23 |
24 | boolean doCollect(World world, BlockPos pos, IBlockState state, EntityPlayer player, ItemStack tool);
25 |
26 | }
27 |
--------------------------------------------------------------------------------
/main/java/defeatedcrow/hac/api/recipe/IMillRecipe.java:
--------------------------------------------------------------------------------
1 | package defeatedcrow.hac.api.recipe;
2 |
3 | import java.util.List;
4 |
5 | import net.minecraft.item.ItemStack;
6 |
7 | /**
8 | * Climate不要の臼引きの1:1交換レシピ。
9 | * 材料は辞書対応。
10 | */
11 | public interface IMillRecipe {
12 |
13 | /**
14 | * Input登録内容
15 | */
16 | Object getInput();
17 |
18 | ItemStack getOutput();
19 |
20 | ItemStack getSecondary();
21 |
22 | float getSecondaryChance();
23 |
24 | /**
25 | * Inputのコンテナアイテムのリスト
26 | */
27 | ItemStack getContainerItem(ItemStack item);
28 |
29 | /**
30 | * macth条件判定用、鉱石辞書変換後のInputリスト
31 | */
32 | List getProcessedInput();
33 |
34 | /**
35 | * Input条件判定
36 | */
37 | boolean matchInput(ItemStack item);
38 |
39 | /**
40 | * Input条件判定
41 | */
42 | boolean matchOutput(List target, ItemStack input, int slotsize);
43 | }
44 |
--------------------------------------------------------------------------------
/main/java/defeatedcrow/hac/api/hook/DCBlockFreezeEvent.java:
--------------------------------------------------------------------------------
1 | package defeatedcrow.hac.api.hook;
2 |
3 | import net.minecraft.util.math.BlockPos;
4 | import net.minecraft.world.World;
5 | import net.minecraftforge.common.MinecraftForge;
6 | import net.minecraftforge.fml.common.eventhandler.Event;
7 | import net.minecraftforge.fml.common.eventhandler.Event.HasResult;
8 |
9 | /**
10 | * asm挿入用の追加イベント
11 | */
12 | @HasResult
13 | public class DCBlockFreezeEvent extends Event {
14 |
15 | public final World world;
16 | public final BlockPos pos;
17 |
18 | public DCBlockFreezeEvent(World worldIn, BlockPos posIn) {
19 | this.pos = posIn;
20 | this.world = worldIn;
21 | }
22 |
23 | public boolean result() {
24 | MinecraftForge.EVENT_BUS.post(this);
25 | if (hasResult() && getResult() == Result.ALLOW) {
26 | return true;
27 | }
28 |
29 | return false;
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/main/java/defeatedcrow/hac/api/damage/IArmorMaterialRegister.java:
--------------------------------------------------------------------------------
1 | package defeatedcrow.hac.api.damage;
2 |
3 | import java.util.HashMap;
4 |
5 | import net.minecraft.item.ItemArmor.ArmorMaterial;
6 |
7 | /**
8 | * 気候ダメージへの耐性をArmorMaterialごとに登録するためのもの。
9 | */
10 | public interface IArmorMaterialRegister {
11 |
12 | HashMap getHeatMap();
13 |
14 | HashMap getColdMap();
15 |
16 | void registerMaterial(ArmorMaterial material, float heat, float cold);
17 |
18 | void registerMaterial(ArmorMaterial material, float f);
19 |
20 | float getHeatPreventAmount(ArmorMaterial material);
21 |
22 | float getColdPreventAmount(ArmorMaterial material);
23 |
24 | /**
25 | * old method
26 | */
27 | void RegisterMaterial(ArmorMaterial material, float f);
28 |
29 | /**
30 | * old method
31 | */
32 | float getPreventAmount(ArmorMaterial material);
33 |
34 | }
35 |
--------------------------------------------------------------------------------
/main/java/defeatedcrow/hac/api/cultivate/GrowingStage.java:
--------------------------------------------------------------------------------
1 | package defeatedcrow.hac.api.cultivate;
2 |
3 | /** 作物の成長段階を表す */
4 | public enum GrowingStage {
5 | GROUND(true, false),
6 | YOUNG(true, false),
7 | FLOWER(true, false),
8 | GROWN(false, true),
9 | DEAD(false, false);
10 |
11 | private final boolean canBonemeal;
12 | private final boolean canHarvest;
13 |
14 | private GrowingStage(boolean a, boolean b) {
15 | canBonemeal = a;
16 | canHarvest = b;
17 | }
18 |
19 | public boolean canUseBonemeal() {
20 | return canBonemeal;
21 | }
22 |
23 | public boolean canHarvestCrop() {
24 | return canHarvest;
25 | }
26 |
27 | public GrowingStage getNextStage() {
28 | if (this == GROUND) {
29 | return YOUNG;
30 | } else if (this == YOUNG) {
31 | return FLOWER;
32 | } else if (this == FLOWER) {
33 | return GROWN;
34 | } else {
35 | return DEAD;
36 | }
37 | }
38 |
39 | }
40 |
--------------------------------------------------------------------------------
/main/java/defeatedcrow/hac/api/hook/DCCaveOceanBlock.java:
--------------------------------------------------------------------------------
1 | package defeatedcrow.hac.api.hook;
2 |
3 | import net.minecraft.world.chunk.ChunkPrimer;
4 | import net.minecraftforge.common.MinecraftForge;
5 | import net.minecraftforge.fml.common.eventhandler.Event;
6 | import net.minecraftforge.fml.common.eventhandler.Event.HasResult;
7 |
8 | /**
9 | * asm挿入用の追加イベント
10 | */
11 | @HasResult
12 | public class DCCaveOceanBlock extends Event {
13 |
14 | public final ChunkPrimer primer;
15 | public final int x;
16 | public final int y;
17 | public final int z;
18 |
19 | public DCCaveOceanBlock(ChunkPrimer data, int x1, int y1, int z1) {
20 | primer = data;
21 | x = x1;
22 | y = y1;
23 | z = z1;
24 | }
25 |
26 | public boolean result() {
27 | MinecraftForge.EVENT_BUS.post(this);
28 | if (hasResult() && getResult() == Result.ALLOW) {
29 | return true;
30 | }
31 |
32 | return false;
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/main/java/defeatedcrow/hac/core/plugin/jei/FRecipeType.java:
--------------------------------------------------------------------------------
1 | package defeatedcrow.hac.core.plugin.jei;
2 |
3 | import defeatedcrow.hac.api.climate.IClimate;
4 | import net.minecraftforge.fluids.FluidStack;
5 |
6 | public enum FRecipeType {
7 | FREEZING,
8 | STANDARD_STATE,
9 | DRYING,
10 | FERMENTATION,
11 | COOKING,
12 | BOILING,
13 | DISTILLING;
14 |
15 | public static FRecipeType getType(IClimate clm, boolean cooling, FluidStack fluid) {
16 | int t = clm.getHeat().getID();
17 | int h = clm.getHumidity().getID();
18 | int a = clm.getAirflow().getID();
19 | boolean f = fluid != null;
20 | switch (t) {
21 | case 0:
22 | case 1:
23 | case 2:
24 | case 3:
25 | return FREEZING;
26 |
27 | case 4:
28 | case 5:
29 | case 6:
30 | if (h == 0)
31 | return DRYING;
32 | else
33 | return FERMENTATION;
34 | default:
35 | return f ? BOILING : COOKING;
36 | }
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/main/resources/assets/dcs_climate/models/block/dcs_slab_under_base.json:
--------------------------------------------------------------------------------
1 | {
2 | "parent": "block/block",
3 | "ambientocclusion": true,
4 | "textures": {
5 | "particle": "#side"
6 | },
7 | "elements": [
8 | { "from": [ 0, 0, 0 ],
9 | "to": [ 16, 8, 16 ],
10 | "faces": {
11 | "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#down", "cullface": "down" },
12 | "up": { "uv": [ 0, 0, 16, 16 ], "texture": "#up" },
13 | "north": { "uv": [ 0, 8, 16, 16 ], "texture": "#side", "cullface": "north" },
14 | "south": { "uv": [ 0, 8, 16, 16 ], "texture": "#side", "cullface": "south" },
15 | "west": { "uv": [ 0, 8, 16, 16 ], "texture": "#side", "cullface": "west" },
16 | "east": { "uv": [ 0, 8, 16, 16 ], "texture": "#side", "cullface": "east" }
17 | }
18 | }
19 | ]
20 | }
--------------------------------------------------------------------------------
/main/resources/assets/dcs_climate/models/block/dcs_slab_upper_base.json:
--------------------------------------------------------------------------------
1 | {
2 | "parent": "block/block",
3 | "ambientocclusion": true,
4 | "textures": {
5 | "particle": "#side"
6 | },
7 | "elements": [
8 | { "from": [ 0, 8, 0 ],
9 | "to": [ 16, 16, 16 ],
10 | "faces": {
11 | "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#down" },
12 | "up": { "uv": [ 0, 0, 16, 16 ], "texture": "#up", "cullface": "up" },
13 | "north": { "uv": [ 0, 0, 16, 8 ], "texture": "#side", "cullface": "north" },
14 | "south": { "uv": [ 0, 0, 16, 8 ], "texture": "#side", "cullface": "south" },
15 | "west": { "uv": [ 0, 0, 16, 8 ], "texture": "#side", "cullface": "west" },
16 | "east": { "uv": [ 0, 0, 16, 8 ], "texture": "#side", "cullface": "east" }
17 | }
18 | }
19 | ]
20 | }
--------------------------------------------------------------------------------
/main/resources/assets/dcs_climate/models/block/dcs_cube_sided.json:
--------------------------------------------------------------------------------
1 | {
2 | "parent": "block/block",
3 | "ambientocclusion": true,
4 | "textures": {
5 | "particle": "#up"
6 | },
7 | "elements": [
8 | { "from": [ 0, 0, 0 ],
9 | "to": [ 16, 16, 16 ],
10 | "faces": {
11 | "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#down", "cullface": "down" },
12 | "up": { "uv": [ 0, 0, 16, 16 ], "texture": "#up", "cullface": "up" },
13 | "north": { "uv": [ 0, 0, 16, 16 ], "texture": "#ns", "cullface": "north" },
14 | "south": { "uv": [ 0, 0, 16, 16 ], "texture": "#ns", "cullface": "south" },
15 | "west": { "uv": [ 0, 0, 16, 16 ], "texture": "#we", "cullface": "west" },
16 | "east": { "uv": [ 0, 0, 16, 16 ], "texture": "#we", "cullface": "east" }
17 | }
18 | }
19 | ]
20 | }
--------------------------------------------------------------------------------
/main/java/defeatedcrow/hac/core/packet/MHandlerWeatherUpdate.java:
--------------------------------------------------------------------------------
1 | package defeatedcrow.hac.core.packet;
2 |
3 | import defeatedcrow.hac.core.climate.WeatherChecker;
4 | import net.minecraftforge.fml.common.network.simpleimpl.IMessage;
5 | import net.minecraftforge.fml.common.network.simpleimpl.IMessageHandler;
6 | import net.minecraftforge.fml.common.network.simpleimpl.MessageContext;
7 | import net.minecraftforge.fml.relauncher.Side;
8 |
9 | public class MHandlerWeatherUpdate implements IMessageHandler {
10 |
11 | @Override
12 | // IMessageHandlerのメソッド
13 | public IMessage onMessage(MessageWeatherUpdate message, MessageContext ctx) {
14 | if (ctx != null && ctx.side == Side.CLIENT) {
15 | int dim = message.dim;
16 | int cR = message.rainCount;
17 | int cS = message.sunCount;
18 | float rain = message.rain;
19 | WeatherChecker.INSTANCE.setWeather(dim, rain, cR, cS);
20 | }
21 | return null;
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/main/java/defeatedcrow/hac/core/plugin/jei/ClimateEffectiveHandler.java:
--------------------------------------------------------------------------------
1 | package defeatedcrow.hac.core.plugin.jei;
2 |
3 | import mezz.jei.api.recipe.IRecipeHandler;
4 | import mezz.jei.api.recipe.IRecipeWrapper;
5 |
6 | @Deprecated
7 | public class ClimateEffectiveHandler implements IRecipeHandler {
8 |
9 | @Override
10 | public Class getRecipeClass() {
11 | return ClimateEffectiveTile.class;
12 | }
13 |
14 | public String getRecipeCategoryUid() {
15 | return "dcs_climate.effective";
16 | }
17 |
18 | @Override
19 | public IRecipeWrapper getRecipeWrapper(ClimateEffectiveTile recipe) {
20 | return new ClimateEffectiveWrapper(recipe);
21 | }
22 |
23 | @Override
24 | public boolean isRecipeValid(ClimateEffectiveTile recipe) {
25 | return recipe.getInputItem() != null;
26 | }
27 |
28 | @Override
29 | public String getRecipeCategoryUid(ClimateEffectiveTile recipe) {
30 | return getRecipeCategoryUid();
31 | }
32 |
33 | }
34 |
--------------------------------------------------------------------------------
/main/java/defeatedcrow/hac/api/climate/EnumSeason.java:
--------------------------------------------------------------------------------
1 | package defeatedcrow.hac.api.climate;
2 |
3 | import net.minecraft.client.resources.I18n;
4 | import net.minecraft.item.EnumDyeColor;
5 |
6 | public enum EnumSeason {
7 |
8 | SPRING(EnumDyeColor.PINK, 0, "dcs.tip.spring"),
9 | SUMMER(EnumDyeColor.LIME, 1, "dcs.tip.summer"),
10 | AUTUMN(EnumDyeColor.ORANGE, 2, "dcs.tip.autumn"),
11 | WINTER(EnumDyeColor.LIGHT_BLUE, 3, "dcs.tip.winter");
12 |
13 | public final EnumDyeColor color;
14 | public final int id;
15 | public final String name;
16 |
17 | private EnumSeason(EnumDyeColor c, int i, String n) {
18 | color = c;
19 | id = i;
20 | name = n;
21 | }
22 |
23 | public String getName() {
24 | return I18n.format(name);
25 | }
26 |
27 | public static EnumSeason getSeasonFromID(int i) {
28 | if (i == 1)
29 | return SUMMER;
30 | else if (i == 2)
31 | return AUTUMN;
32 | else if (i == 3)
33 | return WINTER;
34 | else
35 | return SPRING;
36 | }
37 |
38 | }
39 |
--------------------------------------------------------------------------------
/main/java/defeatedcrow/hac/api/recipe/IClimateObject.java:
--------------------------------------------------------------------------------
1 | package defeatedcrow.hac.api.recipe;
2 |
3 | import net.minecraft.block.state.IBlockState;
4 | import net.minecraft.util.SoundEvent;
5 | import net.minecraft.util.math.BlockPos;
6 | import net.minecraft.world.World;
7 | import defeatedcrow.hac.api.climate.IClimate;
8 |
9 | /**
10 | * アップデート処理内でClimateレシピを扱うオブジェクトに持たせる。
11 | * メソッド内で、Climate更新、レシピ処理などを全部行う。
12 | */
13 | public interface IClimateObject {
14 |
15 | /** in Block#updateTick method */
16 | IClimate onUpdateClimate(World world, BlockPos pos, IBlockState state);
17 |
18 | boolean onClimateChange(World world, BlockPos pos, IBlockState state, IClimate climate);
19 |
20 | SoundEvent getSE(int meta);
21 |
22 | boolean playSEOnChanging(int meta);
23 |
24 | /** true: update処理後にworld#scheduleUpdateを呼ぶ。 */
25 | boolean isForcedTickUpdate();
26 |
27 | /**
28 | * IClimateをチェックする範囲。
29 | * {heat, hum, air}になるよう返すこと。
30 | */
31 | int[] checkingRange();
32 |
33 | }
34 |
--------------------------------------------------------------------------------
/main/resources/assets/dcs_lib/lang/zh_tw.lang:
--------------------------------------------------------------------------------
1 |
2 | ## item
3 | item.dcs_checker_normal.name=氣候檢測器
4 | item.dcs_repair_patty.name=修補膏
5 |
6 | ## massage
7 | dcs.climate.tip.checker=右鍵:檢查目標座標的Climate值 (範圍2)
8 | dcs_climate.tip.durability=最大耐久度
9 | dcs_climate.tip.harvestlevel=挖掘等級
10 | dcs_climate.tip.resistance=氣候耐性
11 |
12 | dcs.tip.shift=Lshift鍵: 顯示詳情
13 |
14 | dcs_climate.smelting=氣候精煉配方
15 | dcs_climate.recipe=氣候利用合成
16 | dcs_climate.mill=石臼
17 | dcs_climate.fluidcraft=液體加工配方
18 | dcs_climate.reactor=化學反應配方
19 | dcs_climate.crop=氣候利用作物
20 | dcs_climate.effective=氣候影響的方塊
21 | dcs_climate.spinning=紡織機
22 | dcs_climate.biome=生態域氣候情報
23 | dcs_climate.crusher=粉碎機配方
24 |
25 | death.attack.dcs_heat=%1$s被烤的金黃
26 | death.attack.dcs_cold=%1$s被凍成了雪酪
27 |
28 | dcs.potion.freeze_resistance=寒冷耐性
29 | dcs.freeze_resistance=寒冷耐性
30 |
31 | dcs.potion.freeze_res=寒冷耐性
32 | potion.effect.dcs.freeze_res=寒冷耐性藥水
33 | splash_potion.effect.dcs.freeze_res=飛濺 寒冷耐性藥水
34 | lingering_potion.effect.dcs.freeze_res=滯留 寒冷耐性藥水
35 |
--------------------------------------------------------------------------------
/main/java/defeatedcrow/hac/core/util/PotionFreezeResistance.java:
--------------------------------------------------------------------------------
1 | package defeatedcrow.hac.core.util;
2 |
3 | import net.minecraft.client.Minecraft;
4 | import net.minecraft.potion.Potion;
5 | import net.minecraft.util.ResourceLocation;
6 |
7 | public class PotionFreezeResistance extends Potion {
8 |
9 | public PotionFreezeResistance() {
10 | super(false, 0x5050FF);
11 | this.setPotionName("dcs.potion.freeze_res");
12 | this.setIconIndex(1, 1);
13 | }
14 |
15 | @Override
16 | public boolean isInstant() {
17 | return false;
18 | }
19 |
20 | @Override
21 | public boolean isReady(int duration, int amplifier) {
22 | return false;
23 | }
24 |
25 | @Override
26 | public int getStatusIconIndex() {
27 | Minecraft.getMinecraft().getTextureManager()
28 | .bindTexture(new ResourceLocation("dcs_climate:textures/gui/icons_potion_2.png"));
29 | return super.getStatusIconIndex();
30 | }
31 |
32 | @Override
33 | public boolean hasStatusIcon() {
34 | return true;
35 | }
36 |
37 | }
38 |
--------------------------------------------------------------------------------
/main/java/defeatedcrow/hac/api/damage/CamouflageInsideMaterialEvent.java:
--------------------------------------------------------------------------------
1 | package defeatedcrow.hac.api.damage;
2 |
3 | import net.minecraft.block.material.Material;
4 | import net.minecraft.entity.Entity;
5 | import net.minecraftforge.common.MinecraftForge;
6 | import net.minecraftforge.event.entity.EntityEvent;
7 | import net.minecraftforge.fml.common.eventhandler.Event.HasResult;
8 |
9 | /**
10 | * asm挿入用の追加イベント
11 | */
12 | @HasResult
13 | public class CamouflageInsideMaterialEvent extends EntityEvent {
14 |
15 | public final Material material;
16 |
17 | public CamouflageInsideMaterialEvent(Entity entityIn, Material materialIn) {
18 | super(entityIn);
19 | this.material = materialIn;
20 | }
21 |
22 | public boolean result() {
23 | MinecraftForge.EVENT_BUS.post(this);
24 | if (hasResult() && getResult() == Result.ALLOW) {
25 | return true;
26 | }
27 |
28 | return false;
29 | }
30 |
31 | public boolean test() {
32 | return getEntity().isInsideOfMaterial(material);
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/main/java/defeatedcrow/hac/api/hook/DCBlockUpdateEvent.java:
--------------------------------------------------------------------------------
1 | package defeatedcrow.hac.api.hook;
2 |
3 | import java.util.Random;
4 |
5 | import net.minecraft.block.state.IBlockState;
6 | import net.minecraft.util.math.BlockPos;
7 | import net.minecraft.world.World;
8 | import net.minecraftforge.common.MinecraftForge;
9 | import net.minecraftforge.fml.common.eventhandler.Cancelable;
10 | import net.minecraftforge.fml.common.eventhandler.Event;
11 |
12 | /**
13 | * asm挿入用の追加イベント
14 | */
15 | @Cancelable
16 | public class DCBlockUpdateEvent extends Event {
17 |
18 | public final World world;
19 | public final BlockPos pos;
20 | public final IBlockState state;
21 | public final Random rand;
22 |
23 | public DCBlockUpdateEvent(World worldIn, BlockPos posIn, IBlockState stateIn, Random randIn) {
24 | this.pos = posIn;
25 | this.world = worldIn;
26 | this.state = stateIn;
27 | this.rand = randIn;
28 | }
29 |
30 | public boolean post() {
31 | return MinecraftForge.EVENT_BUS.post(this);
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/main/java/defeatedcrow/hac/api/recipe/IMillRecipeRegister.java:
--------------------------------------------------------------------------------
1 | package defeatedcrow.hac.api.recipe;
2 |
3 | import java.util.List;
4 |
5 | import net.minecraft.item.ItemStack;
6 |
7 | public interface IMillRecipeRegister {
8 |
9 | /**
10 | * Recipeのリストを得る。
11 | */
12 | List getRecipeList();
13 |
14 | /**
15 | * Recipe登録
16 | *
17 | * @param output
18 | * : 完成品
19 | * @param secondary
20 | * : 副生物 null可
21 | * @param secondaryChance
22 | * : 副生成物の生成率 0.0F-1.0F
23 | * @param input
24 | * : 材料
25 | */
26 | void addRecipe(ItemStack output, ItemStack secondary, float secondaryChance, Object input);
27 |
28 | void addRecipe(ItemStack output, ItemStack secondary, Object input);
29 |
30 | void addRecipe(ItemStack output, Object input);
31 |
32 | void addRecipe(IMillRecipe recipe);
33 |
34 | /**
35 | * inputs, Climateでレシピを判定
36 | */
37 | IMillRecipe getRecipe(ItemStack input);
38 |
39 | boolean removeRecipe(ItemStack input);
40 |
41 | }
42 |
--------------------------------------------------------------------------------
/main/java/defeatedcrow/hac/api/hook/DCBlockCollidedEvent.java:
--------------------------------------------------------------------------------
1 | package defeatedcrow.hac.api.hook;
2 |
3 | import net.minecraft.block.state.IBlockState;
4 | import net.minecraft.entity.Entity;
5 | import net.minecraft.util.math.BlockPos;
6 | import net.minecraft.world.World;
7 | import net.minecraftforge.common.MinecraftForge;
8 | import net.minecraftforge.fml.common.eventhandler.Cancelable;
9 | import net.minecraftforge.fml.common.eventhandler.Event;
10 |
11 | /**
12 | * asm挿入用の追加イベント
13 | */
14 | @Cancelable
15 | public class DCBlockCollidedEvent extends Event {
16 |
17 | public final World world;
18 | public final BlockPos pos;
19 | public final IBlockState state;
20 | public final Entity entity;
21 |
22 | public DCBlockCollidedEvent(World worldIn, BlockPos posIn, IBlockState stateIn, Entity entityIn) {
23 | this.pos = posIn;
24 | this.world = worldIn;
25 | this.state = stateIn;
26 | this.entity = entityIn;
27 | }
28 |
29 | public boolean post() {
30 | return MinecraftForge.EVENT_BUS.post(this);
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/main/java/defeatedcrow/hac/core/packet/command/MHandlerComDrought.java:
--------------------------------------------------------------------------------
1 | package defeatedcrow.hac.core.packet.command;
2 |
3 | import defeatedcrow.hac.config.CoreConfigDC;
4 | import defeatedcrow.hac.core.climate.WeatherChecker;
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 MHandlerComDrought implements IMessageHandler {
11 |
12 | @Override
13 | // IMessageHandlerのメソッド
14 | public IMessage onMessage(MessageComDrought message, MessageContext ctx) {
15 | if (ctx != null && ctx.side == Side.CLIENT) {
16 | int data = message.data;
17 | if (data == 0) {
18 | WeatherChecker.INSTANCE.sunCountMap.put(0, 0);
19 | } else {
20 | WeatherChecker.INSTANCE.sunCountMap.put(0, CoreConfigDC.droughtFrequency * 24 + 1);
21 | }
22 | }
23 | return null;
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/main/java/defeatedcrow/hac/core/DCLogger.java:
--------------------------------------------------------------------------------
1 | package defeatedcrow.hac.core;
2 |
3 | import org.apache.logging.log4j.Logger;
4 |
5 | public class DCLogger {
6 |
7 | public static Logger logger() {
8 | return ClimateCore.LOGGER;
9 | }
10 |
11 | public static void debugLog(String s) {
12 | if (ClimateCore.isDebug) {
13 | ClimateCore.LOGGER.debug(s);
14 | }
15 | }
16 |
17 | public static void debugInfoLog(String s) {
18 | if (ClimateCore.isDebug) {
19 | ClimateCore.LOGGER.info(s);
20 | }
21 | }
22 |
23 | public static void debugTrace(String s) {
24 | if (ClimateCore.isDebug) {
25 | ClimateCore.LOGGER.trace(s);
26 | }
27 | }
28 |
29 | public static void traceLog(String s) {
30 | ClimateCore.LOGGER.trace(s);
31 | }
32 |
33 | public static void infoLog(String id, String s) {
34 | ClimateCore.LOGGER.info(id + ": " + s);
35 | }
36 |
37 | public static void infoLog(String s) {
38 | ClimateCore.LOGGER.info(s);
39 | }
40 |
41 | public static void warnLog(String s) {
42 | ClimateCore.LOGGER.warn(s);
43 | }
44 |
45 | }
46 |
--------------------------------------------------------------------------------
/main/java/defeatedcrow/hac/core/util/BiomeCatchDC.java:
--------------------------------------------------------------------------------
1 | package defeatedcrow.hac.core.util;
2 |
3 | import net.minecraft.init.Biomes;
4 | import net.minecraft.util.math.BlockPos;
5 | import net.minecraft.world.World;
6 | import net.minecraft.world.biome.Biome;
7 |
8 | public class BiomeCatchDC {
9 |
10 | private static Biome[] biomeList;
11 | private static int lastChunk = -1;
12 |
13 | public static Biome getBiome(int cx, int cz, World world) {
14 | int x = 8 + (cx * 16);
15 | int z = 8 + (cz * 16);
16 | BlockPos pos = new BlockPos(x, 1, z);
17 | return world.getBiomeProvider().getBiome(pos, Biomes.PLAINS);
18 | }
19 |
20 | public static Biome getBiomeForCoords(int cx, int cz, int px, int pz, World world) {
21 | int x = px + (cx * 16);
22 | int z = pz + (cz * 16);
23 | BlockPos pos = new BlockPos(x, 1, z);
24 | return world.getBiomeProvider().getBiome(pos, Biomes.PLAINS);
25 | }
26 |
27 | public static Biome getBiome(BlockPos pos, World world) {
28 | return world.getBiomeProvider().getBiome(pos, Biomes.PLAINS);
29 | }
30 |
31 | }
32 |
--------------------------------------------------------------------------------
/main/java/defeatedcrow/hac/api/hook/DCBiomeTempEvent.java:
--------------------------------------------------------------------------------
1 | package defeatedcrow.hac.api.hook;
2 |
3 | import net.minecraft.util.math.BlockPos;
4 | import net.minecraft.world.biome.Biome;
5 | import net.minecraftforge.common.MinecraftForge;
6 | import net.minecraftforge.fml.common.eventhandler.Event;
7 | import net.minecraftforge.fml.common.eventhandler.Event.HasResult;
8 |
9 | /**
10 | * asm挿入用の追加イベント
11 | */
12 | @HasResult
13 | public class DCBiomeTempEvent extends Event {
14 |
15 | public final Biome biome;
16 | public final BlockPos pos;
17 | public final float defaultTemp;
18 | public float newTemp;
19 |
20 | public DCBiomeTempEvent(Biome biomeIn, BlockPos posIn) {
21 | this.pos = posIn;
22 | this.biome = biomeIn;
23 | this.defaultTemp = biomeIn.getDefaultTemperature();
24 | this.newTemp = biomeIn.getDefaultTemperature();
25 | }
26 |
27 | public float result() {
28 | MinecraftForge.EVENT_BUS.post(this);
29 | if (hasResult() && getResult() == Result.ALLOW) {
30 | return newTemp;
31 | }
32 |
33 | return defaultTemp;
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/main/java/defeatedcrow/hac/core/packet/MessageClimateUpdate.java:
--------------------------------------------------------------------------------
1 | package defeatedcrow.hac.core.packet;
2 |
3 | import io.netty.buffer.ByteBuf;
4 | import net.minecraft.util.math.BlockPos;
5 | import net.minecraftforge.fml.common.network.simpleimpl.IMessage;
6 |
7 | // ClimateTileの同期用
8 | public class MessageClimateUpdate implements IMessage {
9 |
10 | public int x;
11 | public int y;
12 | public int z;
13 | public int climate;
14 |
15 | public MessageClimateUpdate() {}
16 |
17 | public MessageClimateUpdate(BlockPos pos, int par1) {
18 | this.x = pos.getX();
19 | this.y = pos.getY();
20 | this.z = pos.getZ();
21 | this.climate = par1;
22 | }
23 |
24 | // read
25 | @Override
26 | public void fromBytes(ByteBuf buf) {
27 | this.x = buf.readInt();
28 | this.y = buf.readInt();
29 | this.z = buf.readInt();
30 | this.climate = buf.readInt();
31 | }
32 |
33 | // write
34 | @Override
35 | public void toBytes(ByteBuf buf) {
36 | buf.writeInt(x);
37 | buf.writeInt(y);
38 | buf.writeInt(z);
39 | buf.writeInt(this.climate);
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/main/java/defeatedcrow/hac/core/packet/MessageWeatherUpdate.java:
--------------------------------------------------------------------------------
1 | package defeatedcrow.hac.core.packet;
2 |
3 | import io.netty.buffer.ByteBuf;
4 | import net.minecraftforge.fml.common.network.simpleimpl.IMessage;
5 |
6 | // 天候変更時の通知
7 | public class MessageWeatherUpdate implements IMessage {
8 |
9 | public int dim;
10 | public float rain;
11 | public int rainCount;
12 | public int sunCount;
13 |
14 | public MessageWeatherUpdate() {}
15 |
16 | public MessageWeatherUpdate(int dimention, float rainF, int countR, int countS) {
17 | this.dim = dimention;
18 | this.rain = rainF;
19 | this.rainCount = countR;
20 | this.sunCount = countS;
21 | }
22 |
23 | // read
24 | @Override
25 | public void fromBytes(ByteBuf buf) {
26 | this.dim = buf.readInt();
27 | this.rain = buf.readFloat();
28 | this.rainCount = buf.readInt();
29 | this.sunCount = buf.readInt();
30 | }
31 |
32 | // write
33 | @Override
34 | public void toBytes(ByteBuf buf) {
35 | buf.writeInt(dim);
36 | buf.writeFloat(rain);
37 | buf.writeInt(rainCount);
38 | buf.writeInt(sunCount);
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/main/java/defeatedcrow/hac/api/climate/IHeatBlockRegister.java:
--------------------------------------------------------------------------------
1 | package defeatedcrow.hac.api.climate;
2 |
3 | import java.util.Map;
4 |
5 | import net.minecraft.block.Block;
6 |
7 | /**
8 | * IHeatTile等の環境に影響させるインターフェイスを実装できない、バニラBlockなどをここで登録する。
9 | * IHeatSourceと異なり、環境要因なので燃料などは消費しない、恒久的に稼働する熱源を登録する。
10 | */
11 | public interface IHeatBlockRegister {
12 |
13 | void registerHeatBlock(Block block, int meta, DCHeatTier temp);
14 |
15 | void registerHumBlock(Block block, int meta, DCHumidity hum);
16 |
17 | void registerAirBlock(Block block, int meta, DCAirflow air);
18 |
19 | DCHeatTier getHeatTier(Block block, int meta);
20 |
21 | DCHumidity getHumidity(Block block, int meta);
22 |
23 | DCAirflow getAirflow(Block block, int meta);
24 |
25 | boolean isRegisteredHeat(Block block, int meta);
26 |
27 | boolean isRegisteredHum(Block block, int meta);
28 |
29 | boolean isRegisteredAir(Block block, int meta);
30 |
31 | Map getHeatList();
32 |
33 | Map getHumList();
34 |
35 | Map getAirList();
36 |
37 | }
38 |
--------------------------------------------------------------------------------
/main/resources/assets/dcs_climate/models/block/dcs_cross.json:
--------------------------------------------------------------------------------
1 | {
2 | "ambientocclusion": false,
3 | "textures": {
4 | "particle": "dcs_climate:blocks/crop/shrub_1",
5 | "crop": "dcs_climate:blocks/crop/shrub_1"
6 | },
7 | "elements": [
8 | { "from": [ 0.8, -0.7, 8 ],
9 | "to": [ 15.2, 15.3, 8 ],
10 | "rotation": { "origin": [ 8, 8, 8 ], "axis": "y", "angle": 45, "rescale": true },
11 | "shade": true,
12 | "faces": {
13 | "north": { "uv": [ 0, 0, 16, 16 ], "texture": "#crop" },
14 | "south": { "uv": [ 0, 0, 16, 16 ], "texture": "#crop" }
15 | }
16 | },
17 | { "from": [ 8, -0.7, 0.8 ],
18 | "to": [ 8, 15.3, 15.2 ],
19 | "rotation": { "origin": [ 8, 8, 8 ], "axis": "y", "angle": 45, "rescale": true },
20 | "shade": true,
21 | "faces": {
22 | "west": { "uv": [ 0, 0, 16, 16 ], "texture": "#crop" },
23 | "east": { "uv": [ 0, 0, 16, 16 ], "texture": "#crop" }
24 | }
25 | }
26 | ]
27 | }
--------------------------------------------------------------------------------
/main/java/defeatedcrow/hac/core/plugin/ChastMobPlugin.java:
--------------------------------------------------------------------------------
1 | package defeatedcrow.hac.core.plugin;
2 |
3 | import defeatedcrow.hac.api.magic.IJewelCharm;
4 | import defeatedcrow.hac.core.util.DCUtil;
5 | import net.minecraft.entity.EntityLivingBase;
6 | import net.minecraft.inventory.IInventory;
7 | import net.minecraft.item.ItemStack;
8 | import net.minecraft.util.NonNullList;
9 |
10 | public class ChastMobPlugin {
11 |
12 | public static NonNullList getCharms(EntityLivingBase living) {
13 | NonNullList ret = NonNullList.create();
14 | if (living instanceof schr0.chastmob.entity.EntityChast) {
15 | IInventory inv = ((schr0.chastmob.entity.EntityChast) living).getInventoryMain();
16 | for (int i = 0; i < inv.getSizeInventory(); i++) {
17 | ItemStack check = inv.getStackInSlot(i);
18 | if (!DCUtil.isEmpty(check) && check.getItem() instanceof IJewelCharm) {
19 | ret.add(check);
20 | }
21 | }
22 | }
23 | return ret;
24 | }
25 |
26 | public static boolean isChastMob(EntityLivingBase living) {
27 | return living instanceof schr0.chastmob.entity.EntityChast;
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/main/java/defeatedcrow/hac/core/recipe/HaCRecipeCondition.java:
--------------------------------------------------------------------------------
1 | package defeatedcrow.hac.core.recipe;
2 |
3 | import java.util.function.BooleanSupplier;
4 |
5 | import com.google.gson.JsonObject;
6 |
7 | import defeatedcrow.hac.api.module.HaCModule;
8 | import net.minecraft.util.JsonUtils;
9 | import net.minecraftforge.common.crafting.IConditionFactory;
10 | import net.minecraftforge.common.crafting.JsonContext;
11 | import net.minecraftforge.fml.common.Loader;
12 |
13 | public class HaCRecipeCondition implements IConditionFactory {
14 |
15 | @Override
16 | public BooleanSupplier parse(JsonContext context, JsonObject json) {
17 | if (JsonUtils.hasField(json, "module")) {
18 | String moduleID = JsonUtils.getString(json, "module");
19 | HaCModule module = HaCModule.getModule(moduleID);
20 | if (module == HaCModule.PLUGIN && JsonUtils.hasField(json, "modid")) {
21 | String modID = JsonUtils.getString(json, "modid");
22 | return () -> modID != null && Loader.isModLoaded(modID);
23 | }
24 | return () -> module == HaCModule.CORE || module.enabled;
25 | }
26 |
27 | return () -> true;
28 | }
29 |
30 | }
31 |
--------------------------------------------------------------------------------
/main/java/defeatedcrow/hac/api/hook/DCItemEatEvent.java:
--------------------------------------------------------------------------------
1 | package defeatedcrow.hac.api.hook;
2 |
3 | import net.minecraft.entity.EntityLivingBase;
4 | import net.minecraft.item.ItemStack;
5 | import net.minecraft.potion.PotionEffect;
6 | import net.minecraft.world.World;
7 | import net.minecraftforge.common.MinecraftForge;
8 | import net.minecraftforge.fml.common.eventhandler.Event;
9 | import net.minecraftforge.fml.common.eventhandler.Event.HasResult;
10 |
11 | /**
12 | * asm挿入用の追加イベント
13 | */
14 | @HasResult
15 | public class DCItemEatEvent extends Event {
16 |
17 | public final World world;
18 | public final EntityLivingBase living;
19 | public final ItemStack item;
20 | public final PotionEffect potion;
21 |
22 | public DCItemEatEvent(ItemStack stack, World worldIn, EntityLivingBase livingIn, PotionEffect potionIn) {
23 | world = worldIn;
24 | living = livingIn;
25 | item = stack;
26 | potion = potionIn;
27 | }
28 |
29 | public boolean result() {
30 | MinecraftForge.EVENT_BUS.post(this);
31 | if (hasResult() && getResult() == Result.ALLOW) {
32 | return true;
33 | }
34 |
35 | return false;
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/main/java/defeatedcrow/hac/core/client/event/WaterFogEvent.java:
--------------------------------------------------------------------------------
1 | package defeatedcrow.hac.core.client.event;
2 |
3 | import defeatedcrow.hac.config.CoreConfigDC;
4 | import net.minecraft.block.material.Material;
5 | import net.minecraft.client.renderer.GlStateManager;
6 | import net.minecraftforge.client.event.EntityViewRenderEvent;
7 | import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
8 |
9 | public class WaterFogEvent {
10 |
11 | @SubscribeEvent
12 | public void onFogDencity(EntityViewRenderEvent.FogDensity event) {
13 | if (CoreConfigDC.waterFix > 0D && event.getState() != null
14 | && event.getState().getMaterial() == Material.WATER) {
15 | // water fog fix
16 | GlStateManager.setFog(GlStateManager.FogMode.EXP);
17 | event.setDensity((float) CoreConfigDC.waterFix);
18 | event.setCanceled(true);
19 | }
20 | if (CoreConfigDC.lavaFix > 0D && event.getState() != null && event.getState().getMaterial() == Material.LAVA) {
21 | // lava fog fix
22 | GlStateManager.setFog(GlStateManager.FogMode.EXP);
23 | event.setDensity((float) CoreConfigDC.lavaFix);
24 | event.setCanceled(true);
25 | }
26 | }
27 |
28 | }
29 |
--------------------------------------------------------------------------------
/main/java/defeatedcrow/hac/api/hook/DCItemDisplayNameEvent.java:
--------------------------------------------------------------------------------
1 | package defeatedcrow.hac.api.hook;
2 |
3 | import defeatedcrow.hac.core.util.DCUtil;
4 | import net.minecraft.client.resources.I18n;
5 | import net.minecraft.item.ItemStack;
6 | import net.minecraftforge.common.MinecraftForge;
7 | import net.minecraftforge.fml.common.eventhandler.Cancelable;
8 | import net.minecraftforge.fml.common.eventhandler.Event;
9 |
10 | /**
11 | * asm挿入用の追加イベント
12 | */
13 | @Cancelable
14 | public class DCItemDisplayNameEvent extends Event {
15 |
16 | public final ItemStack stack;
17 | public final String defaultName;
18 | public String newName;
19 |
20 | public DCItemDisplayNameEvent(ItemStack in) {
21 | this.stack = in;
22 | if (DCUtil.isEmpty(in)) {
23 | defaultName = "EMPTY";
24 | newName = "EMPTY";
25 | } else {
26 | String s = in.getUnlocalizedName() + ".name";
27 | defaultName = I18n.format(s);
28 | newName = defaultName;
29 | }
30 | }
31 |
32 | public String post() {
33 | MinecraftForge.EVENT_BUS.post(this);
34 | if (hasResult() && getResult() == Result.ALLOW) {
35 | return newName;
36 | }
37 |
38 | return defaultName;
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/main/java/defeatedcrow/hac/api/energy/capability/ITorqueHandler.java:
--------------------------------------------------------------------------------
1 | package defeatedcrow.hac.api.energy.capability;
2 |
3 | import java.util.List;
4 |
5 | import net.minecraft.nbt.NBTTagCompound;
6 | import net.minecraft.util.EnumFacing;
7 | import net.minecraft.util.math.BlockPos;
8 | import net.minecraft.world.World;
9 |
10 | public interface ITorqueHandler {
11 |
12 | List getOutputSide();
13 |
14 | float getTorqueAmount();
15 |
16 | boolean canProvideTorque(World world, BlockPos outputPos, EnumFacing output);
17 |
18 | /**
19 | * マシンの持つoutput方向への出力処理を呼ぶ
20 | */
21 | float provideTorque(World world, BlockPos outputPos, EnumFacing output, boolean sim);
22 |
23 | boolean canProvideTorque(float amount, EnumFacing output);
24 |
25 | /**
26 | * マシンからトルクを吸い出す処理
27 | */
28 | float provideTorque(float amount, EnumFacing output, boolean sim);
29 |
30 | boolean canReceiveTorque(float amount, EnumFacing input);
31 |
32 | /**
33 | * トルクを受け入れる処理
34 | */
35 | float receiveTorque(float amount, EnumFacing input, boolean sim);
36 |
37 | NBTTagCompound writeToNBTTag(NBTTagCompound tag);
38 |
39 | void readFromTag(NBTTagCompound tag);
40 |
41 | }
42 |
--------------------------------------------------------------------------------
/main/java/defeatedcrow/hac/core/packet/MHandlerClimateTile.java:
--------------------------------------------------------------------------------
1 | package defeatedcrow.hac.core.packet;
2 |
3 | import defeatedcrow.hac.core.ClimateCore;
4 | import net.minecraft.entity.player.EntityPlayer;
5 | import net.minecraft.tileentity.TileEntity;
6 | import net.minecraft.util.math.BlockPos;
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 |
11 | public class MHandlerClimateTile implements IMessageHandler {
12 |
13 | @Override
14 | // IMessageHandlerのメソッド
15 | public IMessage onMessage(MessageClimateUpdate message, MessageContext ctx) {
16 | EntityPlayer player = ClimateCore.proxy.getPlayer();
17 | if (player != null) {
18 | int x = message.x;
19 | int y = message.y;
20 | int z = message.z;
21 | int clm = message.climate;
22 | TileEntity tile = player.world.getTileEntity(new BlockPos(x, y, z));
23 | if (tile instanceof IClimateUpdateTile) {
24 | ((IClimateUpdateTile) tile).setClimate(clm);
25 | }
26 | }
27 | return null;
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/main/java/defeatedcrow/hac/core/climate/recipe/ClimateCropRegister.java:
--------------------------------------------------------------------------------
1 | package defeatedcrow.hac.core.climate.recipe;
2 |
3 | import java.util.HashMap;
4 | import java.util.Map;
5 |
6 | import net.minecraft.block.Block;
7 | import defeatedcrow.hac.api.cultivate.CropAPI;
8 | import defeatedcrow.hac.api.cultivate.IClimateCrop;
9 | import defeatedcrow.hac.api.cultivate.IClimateCropRegister;
10 |
11 | public class ClimateCropRegister implements IClimateCropRegister {
12 |
13 | public IClimateCropRegister instance() {
14 | return CropAPI.register;
15 | }
16 |
17 | private static Map list;
18 |
19 | public ClimateCropRegister() {
20 | list = new HashMap();
21 | }
22 |
23 | @Override
24 | public Map getList() {
25 | return list;
26 | }
27 |
28 | @Override
29 | public void addCropData(IClimateCrop block) {
30 | if (block != null && block instanceof Block) {
31 | Block b = (Block) block;
32 | String name = b.getUnlocalizedName();
33 | if (list.isEmpty()) {
34 | list.put(name, block);
35 | } else if (!list.containsKey(name)) {
36 | list.put(name, block);
37 | }
38 | }
39 | }
40 |
41 | }
42 |
--------------------------------------------------------------------------------
/main/java/defeatedcrow/hac/core/plugin/baubles/CharmItemBase.java:
--------------------------------------------------------------------------------
1 | package defeatedcrow.hac.core.plugin.baubles;
2 |
3 | import baubles.api.IBauble;
4 | import defeatedcrow.hac.api.magic.IJewelCharm;
5 | import defeatedcrow.hac.api.magic.MagicType;
6 | import defeatedcrow.hac.core.base.DCItem;
7 | import net.minecraft.item.ItemStack;
8 | import net.minecraftforge.fml.common.Optional;
9 | import net.minecraftforge.fml.common.Optional.Method;
10 |
11 | @Optional.InterfaceList({
12 | @Optional.Interface(iface = "baubles.api.IBauble", modid = "baubles"),
13 | })
14 | public abstract class CharmItemBase extends DCItem implements IJewelCharm, IBauble {
15 |
16 | @Override
17 | @Method(modid = "baubles")
18 | public baubles.api.BaubleType getBaubleType(ItemStack arg0) {
19 | MagicType type = getType(arg0.getItemDamage());
20 | switch (type) {
21 | case AMULET:
22 | return baubles.api.BaubleType.AMULET;
23 | case BADGE:
24 | return baubles.api.BaubleType.CHARM;
25 | case PENDANT:
26 | return baubles.api.BaubleType.AMULET;
27 | case RING:
28 | return baubles.api.BaubleType.RING;
29 | default:
30 | return baubles.api.BaubleType.CHARM;
31 |
32 | }
33 |
34 | }
35 |
36 | }
37 |
--------------------------------------------------------------------------------
/main/java/defeatedcrow/hac/core/util/DCWaterOpaque.java:
--------------------------------------------------------------------------------
1 | package defeatedcrow.hac.core.util;
2 |
3 | import defeatedcrow.hac.config.CoreConfigDC;
4 | import defeatedcrow.hac.core.DCLogger;
5 | import net.minecraft.block.Block;
6 | import net.minecraft.init.Blocks;
7 | import net.minecraft.util.math.MathHelper;
8 |
9 | public class DCWaterOpaque {
10 |
11 | private DCWaterOpaque() {}
12 |
13 | // waterの透過度をいじってみる
14 | public static void load() {
15 | if (CoreConfigDC.waterFix > 0D) {
16 | DCLogger.debugLog("#####");
17 | Block water = Blocks.WATER;
18 | Block flow = Blocks.FLOWING_WATER;
19 |
20 | int i = MathHelper.floor(CoreConfigDC.waterFix * 255D);
21 | if (i < 0 || i > 255) {
22 | i = 1;
23 | }
24 |
25 | if (water != null) {
26 | water.setLightOpacity(1);
27 | int op = Blocks.WATER.getDefaultState().getLightOpacity();
28 | DCLogger.debugLog("stil water op: " + op);
29 | }
30 |
31 | if (flow != null) {
32 | flow.setLightOpacity(1);
33 | int op2 = Blocks.FLOWING_WATER.getDefaultState().getLightOpacity();
34 | DCLogger.debugLog("flowing water op: " + op2);
35 | }
36 |
37 | DCLogger.debugLog("#####");
38 | }
39 | }
40 |
41 | }
42 |
--------------------------------------------------------------------------------
/main/java/defeatedcrow/hac/core/plugin/jei/MillRecipeHandler.java:
--------------------------------------------------------------------------------
1 | package defeatedcrow.hac.core.plugin.jei;
2 |
3 | import java.util.ArrayList;
4 |
5 | import defeatedcrow.hac.core.climate.recipe.MillRecipe;
6 | import mezz.jei.api.recipe.IRecipeHandler;
7 | import mezz.jei.api.recipe.IRecipeWrapper;
8 | import net.minecraft.item.ItemStack;
9 |
10 | @Deprecated
11 | public class MillRecipeHandler implements IRecipeHandler {
12 |
13 | @Override
14 | public Class getRecipeClass() {
15 | return MillRecipe.class;
16 | }
17 |
18 | public String getRecipeCategoryUid() {
19 | return "dcs_climate.mill";
20 | }
21 |
22 | @Override
23 | public IRecipeWrapper getRecipeWrapper(MillRecipe recipe) {
24 | return new MillRecipeWrapper(recipe);
25 | }
26 |
27 | @Override
28 | public boolean isRecipeValid(MillRecipe recipe) {
29 | ArrayList inputs = new ArrayList();
30 | if (recipe.getProcessedInput() != null) {
31 | inputs.addAll(recipe.getProcessedInput());
32 | return !inputs.isEmpty();
33 | }
34 | return false;
35 | }
36 |
37 | @Override
38 | public String getRecipeCategoryUid(MillRecipe recipe) {
39 | return getRecipeCategoryUid();
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/main/resources/assets/dcs_lib/lang/zh_cn.lang:
--------------------------------------------------------------------------------
1 |
2 | ## item
3 | item.dcs_checker_normal.name=气候检查器
4 | item.dcs_repair_patty.name=修补油灰
5 |
6 | ## massage
7 | dcs.climate.tip.checker=右击能够检测该位置的气候信息(范围2)
8 | dcs_climate.tip.durability=耐久
9 | dcs_climate.tip.harvestlevel=挖掘等级
10 | dcs_climate.tip.resistance=气候抗性
11 |
12 | dcs.tip.shift=按下左Shift键查看更多
13 |
14 | dcs_climate.smelting=气候冶炼
15 | dcs_climate.recipe=气候合成
16 | dcs_climate.mill=石臼
17 | dcs_climate.fluidcraft=流体合成
18 | dcs_climate.reactor=化学反应器
19 | dcs_climate.crop=气候作物
20 | dcs_climate.effective=气候效果
21 | dcs_climate.spinning=纺织机
22 | dcs_climate.biome=生物群系气候信息
23 | dcs_climate.crusher=锤式粉碎机配方
24 |
25 | death.attack.dcs_heat=%1$s 被烤的焦黄。
26 | death.attack.dcs_cold=%1$s 变成了冰冻果子露。
27 | death.attack.dcs_water=%1$s 淹死了。
28 | death.attack.dcs_dry=%1$s 被风干了。
29 | death.attack.dcs_wind=%1$s 被风吹走了。
30 | death.attack.dcs_suffocation=%1$s 窒息了。
31 | death.attack.dcs_machine=%1$s 因工伤去世。
32 |
33 | dcs.potion.freeze_resistance=严寒耐性
34 | dcs.freeze_resistance=严寒耐性
35 |
36 | dcs.potion.freeze_res=严寒耐性
37 | potion.effect.dcs.freeze_res=严寒耐性药水
38 | splash_potion.effect.dcs.freeze_res=喷溅型严寒耐性药水
39 | lingering_potion.effect.dcs.freeze_res=滞留型严寒耐性药水
40 | tipped_arrow.effect.dcs.freeze_res=严寒耐性箭矢
41 |
42 |
43 |
--------------------------------------------------------------------------------
/main/java/defeatedcrow/hac/core/plugin/jei/CrusherRecipeHandler.java:
--------------------------------------------------------------------------------
1 | package defeatedcrow.hac.core.plugin.jei;
2 |
3 | import java.util.ArrayList;
4 |
5 | import defeatedcrow.hac.core.climate.recipe.CrusherRecipe;
6 | import mezz.jei.api.recipe.IRecipeHandler;
7 | import mezz.jei.api.recipe.IRecipeWrapper;
8 | import net.minecraft.item.ItemStack;
9 |
10 | @Deprecated
11 | public class CrusherRecipeHandler implements IRecipeHandler {
12 |
13 | @Override
14 | public Class getRecipeClass() {
15 | return CrusherRecipe.class;
16 | }
17 |
18 | public String getRecipeCategoryUid() {
19 | return "dcs_climate.crusher";
20 | }
21 |
22 | @Override
23 | public IRecipeWrapper getRecipeWrapper(CrusherRecipe recipe) {
24 | return new CrusherRecipeWrapper(recipe);
25 | }
26 |
27 | @Override
28 | public boolean isRecipeValid(CrusherRecipe recipe) {
29 | ArrayList inputs = new ArrayList();
30 | if (recipe.getProcessedInput() != null) {
31 | inputs.addAll(recipe.getProcessedInput());
32 | return !inputs.isEmpty();
33 | }
34 | return false;
35 | }
36 |
37 | @Override
38 | public String getRecipeCategoryUid(CrusherRecipe recipe) {
39 | return getRecipeCategoryUid();
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/main/java/defeatedcrow/hac/api/recipe/ICrusherRecipe.java:
--------------------------------------------------------------------------------
1 | package defeatedcrow.hac.api.recipe;
2 |
3 | import java.util.List;
4 |
5 | import javax.annotation.Nullable;
6 |
7 | import net.minecraft.item.ItemStack;
8 | import net.minecraftforge.fluids.FluidStack;
9 |
10 | /**
11 | * Climateを条件に進む、液体加工を含む多対多のレシピ。
12 | * 材料は辞書対応。
13 | * 甕での発酵、蒸留器での蒸留の両方で扱う。
14 | */
15 | public interface ICrusherRecipe {
16 |
17 | /**
18 | * Input登録内容
19 | */
20 | Object getInput();
21 |
22 | @Nullable
23 | ItemStack getOutput();
24 |
25 | @Nullable
26 | ItemStack getSecondary();
27 |
28 | @Nullable
29 | ItemStack getTertialy();
30 |
31 | @Nullable
32 | ItemStack getCatalyst();
33 |
34 | @Nullable
35 | FluidStack getOutputFluid();
36 |
37 | float getChance();
38 |
39 | float getSecondaryChance();
40 |
41 | float getTertialyChance();
42 |
43 | /**
44 | * macth条件判定用、鉱石辞書変換後のInputリスト
45 | */
46 | List getProcessedInput();
47 |
48 | /**
49 | * Input条件判定
50 | */
51 | boolean matches(ItemStack in);
52 |
53 | /**
54 | * Output条件判定
55 | */
56 | boolean matchOutput(List target, FluidStack fluid, int slotsize);
57 |
58 | /**
59 | * 触媒条件判定
60 | */
61 | boolean matchCatalyst(ItemStack catalyst);
62 | }
63 |
--------------------------------------------------------------------------------
/main/java/defeatedcrow/hac/core/event/TickEventDC.java:
--------------------------------------------------------------------------------
1 | package defeatedcrow.hac.core.event;
2 |
3 | import java.util.HashMap;
4 | import java.util.Map;
5 |
6 | import defeatedcrow.hac.core.climate.WeatherChecker;
7 | import defeatedcrow.hac.core.util.DCTimeHelper;
8 | import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
9 | import net.minecraftforge.fml.common.gameevent.TickEvent;
10 | import net.minecraftforge.fml.relauncher.Side;
11 |
12 | // 常時監視系
13 | public class TickEventDC {
14 |
15 | private static final Map prevTime = new HashMap();
16 |
17 | // Weather checker
18 | @SubscribeEvent
19 | public void onTickEvent(TickEvent.WorldTickEvent event) {
20 | if (event.world != null && !event.world.isRemote && event.side == Side.SERVER) {
21 | int dim = event.world.provider.getDimension();
22 | if (!prevTime.containsKey(dim)) {
23 | prevTime.put(dim, -1);
24 | } else {
25 | int prev = prevTime.get(dim);
26 | int time = DCTimeHelper.realMinute();
27 | if (prev != time) {
28 | prevTime.put(dim, time);
29 |
30 | WeatherChecker.INSTANCE.setWeather(event.world);
31 | WeatherChecker.INSTANCE.sendPacket(event.world);
32 |
33 | }
34 | }
35 | }
36 | }
37 |
38 | }
39 |
--------------------------------------------------------------------------------
/main/java/defeatedcrow/hac/core/plugin/jei/SpinningRecipeHandler.java:
--------------------------------------------------------------------------------
1 | package defeatedcrow.hac.core.plugin.jei;
2 |
3 | import java.util.ArrayList;
4 |
5 | import defeatedcrow.hac.core.climate.recipe.SpinningRecipe;
6 | import mezz.jei.api.recipe.IRecipeHandler;
7 | import mezz.jei.api.recipe.IRecipeWrapper;
8 | import net.minecraft.item.ItemStack;
9 |
10 | @Deprecated
11 | public class SpinningRecipeHandler implements IRecipeHandler {
12 |
13 | @Override
14 | public Class getRecipeClass() {
15 | return SpinningRecipe.class;
16 | }
17 |
18 | public String getRecipeCategoryUid() {
19 | return "dcs_climate.spinning";
20 | }
21 |
22 | @Override
23 | public IRecipeWrapper getRecipeWrapper(SpinningRecipe recipe) {
24 | return new SpinningRecipeWrapper(recipe);
25 | }
26 |
27 | @Override
28 | public boolean isRecipeValid(SpinningRecipe recipe) {
29 | ArrayList inputs = new ArrayList();
30 | if (recipe.getProcessedInput() != null) {
31 | inputs.addAll(recipe.getProcessedInput());
32 | return !inputs.isEmpty();
33 | }
34 | return false;
35 | }
36 |
37 | @Override
38 | public String getRecipeCategoryUid(SpinningRecipe recipe) {
39 | return getRecipeCategoryUid();
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/main/java/defeatedcrow/hac/core/plugin/jei/ClimateSmeltingHandler.java:
--------------------------------------------------------------------------------
1 | package defeatedcrow.hac.core.plugin.jei;
2 |
3 | import java.util.ArrayList;
4 |
5 | import defeatedcrow.hac.core.climate.recipe.ClimateSmelting;
6 | import mezz.jei.api.recipe.IRecipeHandler;
7 | import mezz.jei.api.recipe.IRecipeWrapper;
8 | import net.minecraft.item.ItemStack;
9 |
10 | @Deprecated
11 | public class ClimateSmeltingHandler implements IRecipeHandler {
12 |
13 | @Override
14 | public Class getRecipeClass() {
15 | return ClimateSmelting.class;
16 | }
17 |
18 | public String getRecipeCategoryUid() {
19 | return "dcs_climate.smelting";
20 | }
21 |
22 | @Override
23 | public IRecipeWrapper getRecipeWrapper(ClimateSmelting recipe) {
24 | return new ClimateSmeltingWrapper(recipe);
25 | }
26 |
27 | @Override
28 | public boolean isRecipeValid(ClimateSmelting recipe) {
29 | ArrayList inputs = new ArrayList();
30 | if (recipe.getProcessedInput() != null) {
31 | inputs.addAll(recipe.getProcessedInput());
32 | return !inputs.isEmpty();
33 | }
34 | return false;
35 | }
36 |
37 | @Override
38 | public String getRecipeCategoryUid(ClimateSmelting recipe) {
39 | return getRecipeCategoryUid();
40 | }
41 |
42 | }
43 |
--------------------------------------------------------------------------------
/main/java/defeatedcrow/hac/core/plugin/jei/ClimateCropHandler.java:
--------------------------------------------------------------------------------
1 | package defeatedcrow.hac.core.plugin.jei;
2 |
3 | import defeatedcrow.hac.api.cultivate.IClimateCrop;
4 | import defeatedcrow.hac.core.util.DCUtil;
5 | import mezz.jei.api.recipe.IRecipeHandler;
6 | import mezz.jei.api.recipe.IRecipeWrapper;
7 | import net.minecraft.block.Block;
8 | import net.minecraft.block.state.IBlockState;
9 |
10 | @Deprecated
11 | public class ClimateCropHandler implements IRecipeHandler {
12 |
13 | @Override
14 | public Class getRecipeClass() {
15 | return IClimateCrop.class;
16 | }
17 |
18 | @Override
19 | public IRecipeWrapper getRecipeWrapper(IClimateCrop recipe) {
20 | return new ClimateCropWrapper(recipe);
21 | }
22 |
23 | @Override
24 | public boolean isRecipeValid(IClimateCrop recipe) {
25 | if (recipe instanceof Block) {
26 | IBlockState state = recipe.getGrownState();
27 | if (state != null) {
28 | if (!recipe.getCropItems(state, 0).isEmpty() && !DCUtil.isEmpty(recipe.getSeedItem(state))) {
29 | return true;
30 | }
31 | }
32 | return false;
33 | }
34 | return false;
35 | }
36 |
37 | @Override
38 | public String getRecipeCategoryUid(IClimateCrop recipe) {
39 | return "dcs_climate.crop";
40 | }
41 |
42 | }
43 |
--------------------------------------------------------------------------------
/main/java/defeatedcrow/hac/api/hook/DCRavineWaterEvent.java:
--------------------------------------------------------------------------------
1 | package defeatedcrow.hac.api.hook;
2 |
3 | import net.minecraft.world.chunk.ChunkPrimer;
4 | import net.minecraft.world.gen.MapGenRavine;
5 | import net.minecraftforge.common.MinecraftForge;
6 | import net.minecraftforge.fml.common.eventhandler.Event;
7 | import net.minecraftforge.fml.common.eventhandler.Event.HasResult;
8 |
9 | /**
10 | * asm挿入用の追加イベント
11 | */
12 | @HasResult
13 | public class DCRavineWaterEvent extends Event {
14 |
15 | public final MapGenRavine event;
16 | public final ChunkPrimer data;
17 | public final int x;
18 | public final int y;
19 | public final int z;
20 | public final int cx;
21 | public final int cz;
22 | public final boolean foundTop;
23 |
24 | public DCRavineWaterEvent(MapGenRavine eventIn, ChunkPrimer dataIn, int x1, int y1, int z1, int cx1, int cz1,
25 | boolean foundTopIn) {
26 | this.event = eventIn;
27 | this.data = dataIn;
28 | this.x = x1;
29 | this.y = y1;
30 | this.z = z1;
31 | this.cx = cx1;
32 | this.cz = cz1;
33 | this.foundTop = foundTopIn;
34 | }
35 |
36 | public boolean result() {
37 | MinecraftForge.EVENT_BUS.post(this);
38 | if (hasResult() && getResult() == Result.ALLOW) {
39 | return true;
40 | }
41 |
42 | return false;
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/main/java/defeatedcrow/hac/core/event/EntityAIRunFromHeatsource.java:
--------------------------------------------------------------------------------
1 | package defeatedcrow.hac.core.event;
2 |
3 | import net.minecraft.entity.EntityCreature;
4 | import net.minecraft.entity.ai.EntityAIPanic;
5 | import net.minecraft.entity.ai.RandomPositionGenerator;
6 | import net.minecraft.util.math.Vec3d;
7 |
8 | public class EntityAIRunFromHeatsource extends EntityAIPanic {
9 |
10 | public Vec3d avoidPos;
11 |
12 | public EntityAIRunFromHeatsource(EntityCreature creature, Vec3d pos) {
13 | super(creature, 1.0F);
14 | avoidPos = pos;
15 | }
16 |
17 | @Override
18 | public boolean shouldExecute() {
19 | if (this.avoidPos == null) {
20 | return false;
21 | } else {
22 | // 4blockくらい離れたら終わり
23 | double d = avoidPos.distanceTo(this.creature.getPositionVector());
24 | if (d > 6D) {
25 | return false;
26 | }
27 |
28 | return this.findRandomPosition();
29 | }
30 | }
31 |
32 | @Override
33 | protected boolean findRandomPosition() {
34 | Vec3d vec3d = RandomPositionGenerator.findRandomTargetBlockAwayFrom(this.creature, 5, 4, avoidPos);
35 |
36 | if (vec3d == null) {
37 | return false;
38 | } else {
39 | this.randPosX = vec3d.x;
40 | this.randPosY = vec3d.y;
41 | this.randPosZ = vec3d.z;
42 | return true;
43 | }
44 | }
45 |
46 | }
47 |
--------------------------------------------------------------------------------
/main/java/defeatedcrow/hac/api/magic/MagicColor.java:
--------------------------------------------------------------------------------
1 | package defeatedcrow.hac.api.magic;
2 |
3 | public enum MagicColor {
4 |
5 | RED(true, false, false, false, false),
6 | GREEN(false, true, false, false, false),
7 | BLUE(false, false, true, false, false),
8 | WHITE(false, false, false, true, false),
9 | BLACK(false, false, false, false, true),
10 | RED_GREEN(true, true, false, false, false),
11 | GREEN_WHITE(false, true, false, true, false),
12 | BLUE_BLACK(false, false, true, false, true),
13 | WHITE_BLUE(false, false, true, true, false),
14 | BLACK_RED(true, false, false, false, true),
15 | RED_BLUE(true, false, true, false, false),
16 | GREEN_BLACK(false, true, false, false, true),
17 | BLUE_GREEN(false, true, true, false, false),
18 | WHITE_RED(true, false, false, true, false),
19 | BLACK_WHITE(false, false, false, true, true),
20 | NONE(false, false, false, false, false);
21 |
22 | public final boolean isRed;
23 | public final boolean isGreen;
24 | public final boolean isBlue;
25 | public final boolean isWhite;
26 | public final boolean isBlack;
27 |
28 | MagicColor(boolean red, boolean green, boolean blue, boolean white, boolean black) {
29 | isRed = red;
30 | isGreen = green;
31 | isBlue = blue;
32 | isWhite = white;
33 | isBlack = black;
34 | }
35 |
36 | }
37 |
--------------------------------------------------------------------------------
/main/java/defeatedcrow/hac/core/fluid/FluidDic.java:
--------------------------------------------------------------------------------
1 | package defeatedcrow.hac.core.fluid;
2 |
3 | import java.util.List;
4 |
5 | import com.google.common.collect.Lists;
6 |
7 | import net.minecraftforge.fluids.Fluid;
8 |
9 | public class FluidDic {
10 |
11 | public final String dicName;
12 | public final List fluids = Lists.newArrayList();
13 |
14 | public FluidDic(String name) {
15 | dicName = name;
16 | }
17 |
18 | public boolean match(Fluid fluid) {
19 | if (fluid == null)
20 | return false;
21 |
22 | if (!fluids.isEmpty() && fluids.contains(fluid)) {
23 | return true;
24 | } else if (fluid.getName().contains(dicName)) {
25 | if (!dicName.equalsIgnoreCase("milk"))
26 | return true;
27 | }
28 |
29 | return false;
30 | }
31 |
32 | @Override
33 | public boolean equals(Object obj) {
34 | if (obj != null && obj instanceof FluidDic) {
35 | FluidDic f = (FluidDic) obj;
36 | return f.dicName.hashCode() == dicName.hashCode();
37 | }
38 | return super.equals(obj);
39 | }
40 |
41 | @Override
42 | public int hashCode() {
43 | return dicName == null ? 0 : dicName.hashCode();
44 | }
45 |
46 | @Override
47 | public String toString() {
48 | String name = dicName == null ? "null" : dicName;
49 | return "Dic: " + dicName;
50 | }
51 |
52 | }
53 |
--------------------------------------------------------------------------------
/main/java/defeatedcrow/hac/core/client/base/DCTileModelBase.java:
--------------------------------------------------------------------------------
1 | package defeatedcrow.hac.core.client.base;
2 |
3 | import net.minecraft.client.model.ModelBase;
4 | import net.minecraft.client.model.ModelRenderer;
5 | import net.minecraftforge.fml.relauncher.Side;
6 | import net.minecraftforge.fml.relauncher.SideOnly;
7 |
8 | @SideOnly(Side.CLIENT)
9 | public class DCTileModelBase extends ModelBase {
10 | // fields
11 | ModelRenderer base;
12 |
13 | public DCTileModelBase() {
14 | textureWidth = 128;
15 | textureHeight = 64;
16 |
17 | base = new ModelRenderer(this, 0, 0);
18 | base.addBox(-8F, 7F, -8F, 16, 1, 16);
19 | base.setRotationPoint(0F, 16F, 0F);
20 | base.setTextureSize(128, 64);
21 | base.mirror = true;
22 | setRotation(base, 0F, 0F, 0F);
23 | }
24 |
25 | public void render(float f) {
26 | setRotationAngles(f);
27 | }
28 |
29 | public void render(float f, float speed, float tick) {
30 | setRotationAngles(f, speed, tick);
31 | }
32 |
33 | private void setRotation(ModelRenderer model, float x, float y, float z) {
34 | model.rotateAngleX = x;
35 | model.rotateAngleY = y;
36 | model.rotateAngleZ = z;
37 | }
38 |
39 | public void setRotationAngles(float f) {
40 | }
41 |
42 | public void setRotationAngles(float f, float speed, float tick) {
43 | }
44 |
45 | }
46 |
--------------------------------------------------------------------------------
/main/java/defeatedcrow/hac/core/energy/SidedEnergyWrapper.java:
--------------------------------------------------------------------------------
1 | package defeatedcrow.hac.core.energy;
2 |
3 | import net.minecraftforge.energy.IEnergyStorage;
4 |
5 | public class SidedEnergyWrapper implements IEnergyStorage {
6 |
7 | protected final SidedEnergyStorage tank;
8 | protected final boolean canExtract;
9 | protected final boolean canReceive;
10 |
11 | public SidedEnergyWrapper(SidedEnergyStorage storage, boolean ext, boolean rec) {
12 | tank = storage;
13 | canExtract = ext;
14 | canReceive = rec;
15 | }
16 |
17 | @Override
18 | public int receiveEnergy(int maxReceive, boolean simulate) {
19 | if (!canReceive)
20 | return 0;
21 |
22 | return tank.receiveEnergy(maxReceive, simulate);
23 | }
24 |
25 | @Override
26 | public int extractEnergy(int maxExtract, boolean simulate) {
27 | if (!canExtract)
28 | return 0;
29 |
30 | return tank.extractEnergy(maxExtract, simulate);
31 | }
32 |
33 | @Override
34 | public int getEnergyStored() {
35 | return tank.energy;
36 | }
37 |
38 | @Override
39 | public int getMaxEnergyStored() {
40 | return tank.capacity;
41 | }
42 |
43 | @Override
44 | public boolean canExtract() {
45 | return tank.canExtract();
46 | }
47 |
48 | @Override
49 | public boolean canReceive() {
50 | return tank.canReceive();
51 | }
52 | }
53 |
--------------------------------------------------------------------------------
/main/java/defeatedcrow/hac/core/packet/MessageTorqueTile.java:
--------------------------------------------------------------------------------
1 | package defeatedcrow.hac.core.packet;
2 |
3 | import io.netty.buffer.ByteBuf;
4 | import net.minecraft.util.math.BlockPos;
5 | import net.minecraftforge.fml.common.network.simpleimpl.IMessage;
6 |
7 | // トルクTileの回転加速度の同期用
8 | public class MessageTorqueTile implements IMessage {
9 |
10 | public int x;
11 | public int y;
12 | public int z;
13 | public float torque;
14 | public float accel;
15 | public float accel2;
16 |
17 | public MessageTorqueTile() {}
18 |
19 | public MessageTorqueTile(BlockPos pos, float par1, float par2, float par3) {
20 | this.x = pos.getX();
21 | this.y = pos.getY();
22 | this.z = pos.getZ();
23 | this.torque = par1;
24 | this.accel = par2;
25 | this.accel2 = par3;
26 | }
27 |
28 | // read
29 | @Override
30 | public void fromBytes(ByteBuf buf) {
31 | this.x = buf.readInt();
32 | this.y = buf.readInt();
33 | this.z = buf.readInt();
34 | this.torque = buf.readFloat();
35 | this.accel = buf.readFloat();
36 | this.accel2 = buf.readFloat();
37 | }
38 |
39 | // write
40 | @Override
41 | public void toBytes(ByteBuf buf) {
42 | buf.writeInt(x);
43 | buf.writeInt(y);
44 | buf.writeInt(z);
45 | buf.writeFloat(torque);
46 | buf.writeFloat(accel);
47 | buf.writeFloat(accel2);
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/main/resources/assets/dcs_lib/lang/ja_jp.lang:
--------------------------------------------------------------------------------
1 |
2 | ## item
3 | item.dcs_checker_normal.name=気候チェッカー
4 | item.dcs_repair_patty.name=修繕ペースト
5 |
6 | ## massage
7 | dcs.climate.tip.checker=右クリック:対象の座標のClimate値を調べます (range 2)
8 | dcs_climate.tip.durability=最大耐久値
9 | dcs_climate.tip.harvestlevel=採掘レベル
10 | dcs_climate.tip.resistance=気候耐性
11 |
12 | dcs.tip.shift=Lshiftキー: 詳細を表示
13 |
14 | dcs_climate.smelting=気候精錬レシピ
15 | dcs_climate.recipe=気候利用クラフト
16 | dcs_climate.mill=石臼
17 | dcs_climate.fluidcraft=液体加工レシピ
18 | dcs_climate.reactor=合成反応レシピ
19 | dcs_climate.crop=気候利用作物
20 | dcs_climate.effective=気候に影響するブロック
21 | dcs_climate.spinning=紡績機
22 | dcs_climate.biome=バイオーム気候情報
23 | dcs_climate.crusher=破砕機レシピ
24 |
25 | death.attack.dcs_heat=%1$sはこんがり焼き上がった。
26 | death.attack.dcs_cold=%1$sはシャーベットになった。
27 | death.attack.dcs_water=%1$sはびしょ濡れになった。
28 | death.attack.dcs_dry=%1$sはカサカサに乾いてしまった。
29 | death.attack.dcs_wind=%1$sは風に煽られた。
30 | death.attack.dcs_suffocation=%1$sは窒息してしまった。
31 | death.attack.dcs_machine=%1$sは労働災害に遭った。ご安全に!
32 |
33 | dcs.potion.freeze_resistance=冷気耐性
34 | dcs.freeze_resistance=冷気耐性
35 |
36 | dcs.potion.freeze_res=冷気耐性
37 | potion.effect.dcs.freeze_res=冷気耐性のポーション
38 | splash_potion.effect.dcs.freeze_res=冷気耐性のスプラッシュポーション
39 | lingering_potion.effect.dcs.freeze_res=冷気耐性の残留ポーション
40 | tipped_arrow.effect.dcs.freeze_res=冷気耐性の矢
--------------------------------------------------------------------------------
/main/java/defeatedcrow/hac/core/plugin/jei/CRecipeType.java:
--------------------------------------------------------------------------------
1 | package defeatedcrow.hac.core.plugin.jei;
2 |
3 | import defeatedcrow.hac.api.climate.IClimate;
4 |
5 | public enum CRecipeType {
6 | FREEZING,
7 | STANDARD_STATE,
8 | DRYING,
9 | CULTIVATION,
10 | FERMENTATION,
11 | COOKING,
12 | BOILING,
13 | STEAMING,
14 | COMBUSTION,
15 | PYROLYSIS,
16 | SMELTING;
17 |
18 | public static CRecipeType getType(IClimate clm) {
19 | int t = clm.getHeat().getID();
20 | int h = clm.getHumidity().getID();
21 | int a = clm.getAirflow().getID();
22 | switch (t) {
23 | case 0:
24 | case 1:
25 | case 2:
26 | case 3:
27 | return FREEZING;
28 | case 4:
29 | case 5:
30 | if (h > 1)
31 | return CULTIVATION;
32 | if (h < 0)
33 | return DRYING;
34 | else
35 | return STANDARD_STATE;
36 |
37 | case 6:
38 | case 7:
39 | if (h > 1)
40 | return FERMENTATION;
41 | else
42 | return DRYING;
43 | case 8:
44 | case 9:
45 | case 10:
46 | if (h > 2)
47 | return BOILING;
48 | else if (a < 2)
49 | return PYROLYSIS;
50 | else
51 | return h == 0 ? DRYING : COOKING;
52 | case 11:
53 | case 12:
54 | case 13:
55 | if (a < 2)
56 | return SMELTING;
57 | else
58 | return COMBUSTION;
59 | default:
60 | return STANDARD_STATE;
61 | }
62 | }
63 | }
64 |
--------------------------------------------------------------------------------
/main/java/defeatedcrow/hac/core/packet/MHandlerCharmKey.java:
--------------------------------------------------------------------------------
1 | package defeatedcrow.hac.core.packet;
2 |
3 | import defeatedcrow.hac.api.magic.CharmType;
4 | import defeatedcrow.hac.api.magic.IJewelCharm;
5 | import defeatedcrow.hac.core.util.DCUtil;
6 | import net.minecraft.entity.player.EntityPlayer;
7 | import net.minecraft.item.ItemStack;
8 | import net.minecraft.util.NonNullList;
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 |
13 | public class MHandlerCharmKey implements IMessageHandler {
14 |
15 | @Override
16 | // IMessageHandlerのメソッド
17 | public IMessage onMessage(MessageCharmKey message, MessageContext ctx) {
18 | EntityPlayer player = ctx.getServerHandler().player;
19 | if (player != null) {
20 | NonNullList charms = DCUtil.getPlayerCharm(player, CharmType.KEY);
21 |
22 | // 発動するのは最も左の一つだけ
23 | for (ItemStack check : charms) {
24 | IJewelCharm charm = (IJewelCharm) check.getItem();
25 | if (DCUtil.playerCanUseCharm(player, check) && charm.onUsing(player, check)) {
26 | DCUtil.playerConsumeCharm(player, check);
27 | return null;
28 | }
29 | }
30 | }
31 | return null;
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/main/java/defeatedcrow/hac/core/base/DCTileEntity.java:
--------------------------------------------------------------------------------
1 | package defeatedcrow.hac.core.base;
2 |
3 | import net.minecraft.nbt.NBTTagCompound;
4 | import net.minecraft.tileentity.TileEntity;
5 | import net.minecraft.util.ITickable;
6 |
7 | public class DCTileEntity extends TileEntity implements ITickable {
8 |
9 | @Override
10 | public void readFromNBT(NBTTagCompound compound) {
11 | super.readFromNBT(compound);
12 | this.coolTime = compound.getByte("CoolTime");
13 | }
14 |
15 | @Override
16 | public NBTTagCompound writeToNBT(NBTTagCompound compound) {
17 | super.writeToNBT(compound);
18 | compound.setByte("CoolTime", (byte) coolTime);
19 | return compound;
20 | }
21 |
22 | public NBTTagCompound getNBT(NBTTagCompound tag) {
23 | return tag;
24 | }
25 |
26 | public void setNBT(NBTTagCompound tag) {
27 |
28 | }
29 |
30 | // update
31 | public int coolTime = 20;
32 |
33 | // 更新間隔
34 | protected int getMaxCool() {
35 | return 20;
36 | }
37 |
38 | @Override
39 | public void update() {
40 | if (coolTime > 0) {
41 | coolTime--;
42 | } else {
43 | updateTile();
44 | coolTime = getMaxCool();
45 | }
46 |
47 | onTickUpdate();
48 |
49 | if (!world.isRemote) {
50 | onServerUpdate();
51 | }
52 | }
53 |
54 | public void onTickUpdate() {}
55 |
56 | protected void onServerUpdate() {}
57 |
58 | public void updateTile() {}
59 | }
60 |
--------------------------------------------------------------------------------
/main/resources/assets/dcs_lib/lang/ru_ru.lang:
--------------------------------------------------------------------------------
1 |
2 | ## item
3 | item.dcs_checker_normal.name=Климат-контроль
4 | item.dcs_repair_patty.name=Ремонт Пэтти
5 |
6 | ## massage
7 | dcs.climate.tip.checker=Можно проверить климат правого щелчка на позиции(диапазон 2)
8 | dcs_climate.tip.durability=Макс. прочность
9 | dcs_climate.tip.harvestlevel=Уровень добычи
10 | dcs_climate.tip.resistance=Климатическое сопротивление
11 |
12 | dcs.tip.shift=Клавиша LShift: развернуть подсказку
13 |
14 | dcs_climate.smelting=Климатическая плавка
15 | dcs_climate.recipe=Климатическое создание
16 | dcs_climate.mill=Рецепт мельницы
17 | dcs_climate.fluidcraft=Жидкостная обработка
18 | dcs_climate.reactor=Реакторная обработка
19 | dcs_climate.crop=Климатические культуры
20 | dcs_climate.effective=Климатические эффективные плитки
21 | dcs_climate.spinning=Прядильная машина
22 | dcs_climate.biome=Климатические данные биома
23 | dcs_climate.crusher=Рецепт дробилки
24 |
25 | death.attack.dcs_heat=%1$s был сожжен поджаренным.
26 | death.attack.dcs_cold=%1$s стал шербетом.
27 |
28 | dcs.potion.freeze_res=Морозостойкость
29 | potion.effect.dcs.freeze_res=Зелье морозостойкости
30 | splash_potion.effect.dcs.freeze_res=Всплеск зелье морозостойкости
31 | lingering_potion.effect.dcs.freeze_res=Затяжное зелье морозостойкости
32 |
33 | dcs.tip.spring=ВЕСНА
34 | dcs.tip.summer=ЛЕТО
35 | dcs.tip.autumn=ОСЕНЬ
36 | dcs.tip.winter=ЗИМА
37 |
--------------------------------------------------------------------------------
/main/java/defeatedcrow/hac/core/packet/MHandlerTorqueTile.java:
--------------------------------------------------------------------------------
1 | package defeatedcrow.hac.core.packet;
2 |
3 | import defeatedcrow.hac.core.ClimateCore;
4 | import defeatedcrow.hac.core.energy.TileTorqueBase;
5 | import net.minecraft.entity.player.EntityPlayer;
6 | import net.minecraft.tileentity.TileEntity;
7 | import net.minecraft.util.math.BlockPos;
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 |
12 | public class MHandlerTorqueTile implements IMessageHandler {
13 |
14 | @Override
15 | // IMessageHandlerのメソッド
16 | public IMessage onMessage(MessageTorqueTile message, MessageContext ctx) {
17 | EntityPlayer player = ClimateCore.proxy.getPlayer();
18 | if (player != null) {
19 | int x = message.x;
20 | int y = message.y;
21 | int z = message.z;
22 | float torque = message.torque;
23 | float accel = message.accel;
24 | float accel2 = message.accel2;
25 | TileEntity tile = player.world.getTileEntity(new BlockPos(x, y, z));
26 | if (tile != null && tile instanceof TileTorqueBase) {
27 | ((TileTorqueBase) tile).prevTorque = torque;
28 | // ((TileTorqueBase) tile).effectiveAccel = accel;
29 | // ((TileTorqueBase) tile).prevAccel = accel2;
30 | }
31 | }
32 | return null;
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/main/java/defeatedcrow/hac/api/climate/ClimateCalculateEvent.java:
--------------------------------------------------------------------------------
1 | package defeatedcrow.hac.api.climate;
2 |
3 | import net.minecraft.util.math.BlockPos;
4 | import net.minecraft.world.World;
5 | import net.minecraftforge.common.MinecraftForge;
6 | import net.minecraftforge.fml.common.eventhandler.Event;
7 | import net.minecraftforge.fml.common.eventhandler.Event.HasResult;
8 |
9 | /**
10 | * Climateの算出直前に発火するイベント
11 | * Result.ALLOWの場合、結果を変更できる
12 | */
13 | @HasResult
14 | public class ClimateCalculateEvent extends Event {
15 |
16 | private final World world;
17 | private final BlockPos pos;
18 | private final IClimate prevClimate;
19 | private IClimate newClimate;
20 |
21 | public ClimateCalculateEvent(World worldIn, BlockPos posIn, IClimate prev) {
22 | this.pos = posIn;
23 | this.world = worldIn;
24 | this.prevClimate = prev;
25 | this.newClimate = prev;
26 | }
27 |
28 | public IClimate result() {
29 | MinecraftForge.EVENT_BUS.post(this);
30 | if (hasResult() && getResult() == Result.ALLOW) {
31 | return newClimate;
32 | }
33 |
34 | return prevClimate;
35 | }
36 |
37 | public World getWorld() {
38 | return world;
39 | }
40 |
41 | public BlockPos getPos() {
42 | return pos;
43 | }
44 |
45 | public IClimate currentClimate() {
46 | return prevClimate;
47 | }
48 |
49 | public void setNewClimate(IClimate climate) {
50 | if (climate != null)
51 | newClimate = climate;
52 | }
53 | }
54 |
--------------------------------------------------------------------------------
/main/java/defeatedcrow/hac/api/module/HaCModule.java:
--------------------------------------------------------------------------------
1 | package defeatedcrow.hac.api.module;
2 |
3 | public enum HaCModule {
4 |
5 | DISABLED("disabled", false, false),
6 | CORE("core", false, true),
7 | MACHINE("machine", false, true),
8 | MACHINE_ADVANCED("machine_advanced", true, true),
9 | MAGIC("magic", false, true),
10 | MAGIC_ADVANCED("magic_advanced", true, true),
11 | FOOD("food", false, true),
12 | FOOD_ADVANCED("food_advanced", true, true),
13 | TOOL("tool", false, true),
14 | WEAPON_ADVANCED("weapon_advanced", true, true),
15 | CLOTH_ADVANCED("cloth_advanced", true, true),
16 | BUILD_ADVANCED("build_advanced", true, true),
17 | PLUGIN("plugin", false, false);
18 |
19 | public final String id;
20 | public final boolean isAdvanced;
21 | public boolean enabled;
22 |
23 | public String modid = "dcs_climate"; // plugin only
24 |
25 | private HaCModule(String s, boolean adv, boolean e) {
26 | id = s;
27 | isAdvanced = adv;
28 | }
29 |
30 | public boolean enabled() {
31 | return enabled;
32 | }
33 |
34 | public static HaCModule getModule(String s) {
35 | HaCModule ret = CORE;
36 | for (HaCModule m : HaCModule.values()) {
37 | if (s != null && m.id.equalsIgnoreCase(s)) {
38 | ret = m;
39 | break;
40 | }
41 | }
42 | return ret;
43 | }
44 |
45 | public static HaCModule getPlugin(String s) {
46 | HaCModule ret = PLUGIN;
47 | ret.modid = s;
48 | return ret;
49 | }
50 |
51 | }
52 |
--------------------------------------------------------------------------------
/main/java/defeatedcrow/hac/core/recipe/ConvertTargetList.java:
--------------------------------------------------------------------------------
1 | package defeatedcrow.hac.core.recipe;
2 |
3 | import java.util.ArrayList;
4 | import java.util.HashMap;
5 | import java.util.Map;
6 |
7 | import defeatedcrow.hac.api.climate.ItemSet;
8 | import defeatedcrow.hac.core.util.DCUtil;
9 | import net.minecraft.item.ItemStack;
10 |
11 | public class ConvertTargetList {
12 |
13 | private ConvertTargetList() {}
14 |
15 | private static ArrayList EXCLUSIONS = new ArrayList();
16 |
17 | private static Map REPLACES = new HashMap();
18 |
19 | public static ArrayList getExclusionList() {
20 | return EXCLUSIONS;
21 | }
22 |
23 | public static Map getReplaceTable() {
24 | return REPLACES;
25 | }
26 |
27 | public static void addExclusing(ItemStack item) {
28 | if (DCUtil.isEmpty(item)) {
29 | return;
30 | }
31 | ItemSet add = new ItemSet(item);
32 | if (!EXCLUSIONS.contains(add)) {
33 | EXCLUSIONS.add(add);
34 | // DCLogger.debugLog("add ex: " + item.toString());
35 | }
36 | }
37 |
38 | public static void addReplaceTarget(ItemStack item, String name) {
39 | if (DCUtil.isEmpty(item) || name == null) {
40 | return;
41 | }
42 | ItemSet add = new ItemSet(item);
43 | if (!REPLACES.keySet().contains(add)) {
44 | REPLACES.put(add, name);
45 | // DCLogger.debugLog("add rep: " + item.toString());
46 | }
47 | }
48 |
49 | }
50 |
--------------------------------------------------------------------------------
/main/java/defeatedcrow/hac/core/event/SuffocationEventDC.java:
--------------------------------------------------------------------------------
1 | package defeatedcrow.hac.core.event;
2 |
3 | import defeatedcrow.hac.api.climate.ClimateAPI;
4 | import defeatedcrow.hac.api.climate.DCAirflow;
5 | import defeatedcrow.hac.api.damage.CamouflageInsideMaterialEvent;
6 | import net.minecraft.block.material.Material;
7 | import net.minecraft.block.state.IBlockState;
8 | import net.minecraft.entity.Entity;
9 | import net.minecraft.entity.passive.EntityTameable;
10 | import net.minecraft.entity.player.EntityPlayer;
11 | import net.minecraft.util.math.BlockPos;
12 | import net.minecraftforge.fml.common.eventhandler.Event.Result;
13 | import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
14 |
15 | public class SuffocationEventDC {
16 |
17 | @SubscribeEvent
18 | public void CamouflageInWater(CamouflageInsideMaterialEvent event) {
19 | Entity target = event.getEntity();
20 | Material mat = event.material;
21 | if (target != null && target.isEntityAlive() && mat == Material.WATER) {
22 | boolean isTarget = target instanceof EntityPlayer || target instanceof EntityTameable;
23 | double d0 = target.posY + target.getEyeHeight();
24 | BlockPos pos = new BlockPos(target.posX, d0, target.posZ);
25 | IBlockState state = target.world.getBlockState(pos);
26 | if (isTarget && ClimateAPI.calculator.getAirflow(target.world, pos) == DCAirflow.TIGHT) {
27 | event.setResult(Result.ALLOW);
28 | }
29 | }
30 | }
31 |
32 | }
33 |
--------------------------------------------------------------------------------
/main/java/defeatedcrow/hac/asm/DCASMCore.java:
--------------------------------------------------------------------------------
1 | package defeatedcrow.hac.asm;
2 |
3 | import java.security.cert.Certificate;
4 | import java.util.Arrays;
5 |
6 | import javax.annotation.Nullable;
7 |
8 | import com.google.common.eventbus.EventBus;
9 |
10 | import net.minecraftforge.fml.common.DummyModContainer;
11 | import net.minecraftforge.fml.common.LoadController;
12 | import net.minecraftforge.fml.common.ModMetadata;
13 |
14 | public class DCASMCore extends DummyModContainer {
15 |
16 | private Certificate certificate;
17 |
18 | public DCASMCore() {
19 | super(new ModMetadata());
20 |
21 | ModMetadata meta = super.getMetadata();
22 | meta.modId = "dcs_asm";
23 | meta.name = "HeatAndClimateASM";
24 | meta.version = "2.1.0";
25 | // 以下は省略可
26 | meta.authorList = Arrays.asList(new String[] {
27 | "defeatedcrow"
28 | });
29 | meta.credits = "defeatedcrow";
30 | meta.url = "http://defeatedcrow.jp/modwiki/HeatAndClimate";
31 | meta.description = "Method transformar for the climate.";
32 |
33 | Certificate[] certificates = getClass().getProtectionDomain().getCodeSource().getCertificates();
34 | certificate = certificates != null ? certificates[0] : null;
35 | }
36 |
37 | @Override
38 | public boolean registerBus(EventBus bus, LoadController lc) {
39 | bus.register(this);
40 | return true;
41 | }
42 |
43 | @Override
44 | @Nullable
45 | public Certificate getSigningCertificate() {
46 | return certificate;
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/main/resources/License.txt:
--------------------------------------------------------------------------------
1 | Copyright (c) defeatedcrow, 2020
2 | URL:http://defeatedcrow.jp/modwiki/Mainpage
3 |
4 | このmodは以下のライセンスの元で公開されます。
5 | This mod is distributed under the following license:
6 |
7 | #Code: All Rights Reserved
8 |
9 | Conditions
10 | - 著作権者の表示 Copyright notice
11 | - 商用利用禁止 Commercial use prohibition
12 |
13 | Permissions
14 | - ソースコードを改変したり、あなたのmodプロジェクトに利用することができます。
15 | You can fork, modify, or use the code in your project.
16 | - このmodの非改変バイナリパッケージをmodpackに同梱したり、マルチプレイサーバー内で再配布することができます。
17 | You can redistribute this mod's unmodified binary package to modpack or multiplayer server.
18 | - このmodを導入したマインクラフトのサーバー、modpack、およびゲームプレイの映像については、作者の同意を得ることなく、商用目的で利用することができます。
19 | You can use Minecraft server, modpack, and gameplay footage that introduced this mod for commercial purposes without consent of the author.
20 |
21 | Limitations
22 | - このmodは「現状のまま」提供され、一切の動作を保証しません。
23 | This mod is provided "as is" without warranty of any kind.
24 | - 作者および著作権者は、いかなる場合でも、このmodの使用その他によって生じる責任を負いません。
25 | In any case, the author or copyright holder is not responsible for any claims, damages or other liabilities arising out of this mod or its use.
26 | - このライセンスは、Mojang社のEULA条項に代わって適用されるものではありません。ユーザーがマインクラフトを利用するにあたっては、Mojang社のEULAを遵守する必要があります。
27 | This license does not replace Mojang's EULA terms. Users must comply with Mojang's EULA to use this mod.
28 |
29 | #Assets: CC-BY-NC-SA 4.0
30 | https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode
31 |
--------------------------------------------------------------------------------
/main/java/defeatedcrow/hac/api/hook/DCCaveWaterEvent.java:
--------------------------------------------------------------------------------
1 | package defeatedcrow.hac.api.hook;
2 |
3 | import net.minecraft.block.state.IBlockState;
4 | import net.minecraft.world.chunk.ChunkPrimer;
5 | import net.minecraft.world.gen.MapGenCaves;
6 | import net.minecraftforge.common.MinecraftForge;
7 | import net.minecraftforge.fml.common.eventhandler.Event;
8 | import net.minecraftforge.fml.common.eventhandler.Event.HasResult;
9 |
10 | /**
11 | * asm挿入用の追加イベント
12 | */
13 | @HasResult
14 | public class DCCaveWaterEvent extends Event {
15 |
16 | public final MapGenCaves event;
17 | public final ChunkPrimer data;
18 | public final int x;
19 | public final int y;
20 | public final int z;
21 | public final int cx;
22 | public final int cz;
23 | public final boolean foundTop;
24 | public final IBlockState state;
25 | public final IBlockState up;
26 |
27 | public DCCaveWaterEvent(MapGenCaves eventIn, ChunkPrimer dataIn, int x1, int y1, int z1, int cx1, int cz1,
28 | boolean foundTopIn, IBlockState stateIn, IBlockState upIn) {
29 | this.event = eventIn;
30 | this.data = dataIn;
31 | this.x = x1;
32 | this.y = y1;
33 | this.z = z1;
34 | this.cx = cx1;
35 | this.cz = cz1;
36 | this.foundTop = foundTopIn;
37 | this.state = stateIn;
38 | this.up = upIn;
39 | }
40 |
41 | public boolean result() {
42 | MinecraftForge.EVENT_BUS.post(this);
43 | if (hasResult() && getResult() == Result.ALLOW) {
44 | return true;
45 | }
46 |
47 | return false;
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/main/java/defeatedcrow/hac/core/plugin/jei/ingredients/AirflowRenderer.java:
--------------------------------------------------------------------------------
1 | package defeatedcrow.hac.core.plugin.jei.ingredients;
2 |
3 | import java.util.ArrayList;
4 | import java.util.List;
5 |
6 | import defeatedcrow.hac.api.climate.DCAirflow;
7 | import mezz.jei.api.ingredients.IIngredientRenderer;
8 | import net.minecraft.client.Minecraft;
9 | import net.minecraft.client.gui.FontRenderer;
10 | import net.minecraft.client.util.ITooltipFlag;
11 |
12 | public class AirflowRenderer implements IIngredientRenderer {
13 | private final int width;
14 | private final int height;
15 | private final boolean show;
16 |
17 | public AirflowRenderer() {
18 | this(false, 16, 16);
19 | }
20 |
21 | public AirflowRenderer(int w, int h) {
22 | this(true, w, h);
23 | }
24 |
25 | public AirflowRenderer(boolean s, int w, int h) {
26 | show = s;
27 | width = w;
28 | height = h;
29 | }
30 |
31 | @Override
32 | public void render(Minecraft minecraft, int xPosition, int yPosition, DCAirflow ingredient) {
33 | return;
34 | }
35 |
36 | @Override
37 | public List getTooltip(Minecraft minecraft, DCAirflow ingredient, ITooltipFlag tooltipFlag) {
38 | List tooltip = new ArrayList();
39 | if (ingredient != null) {
40 | tooltip.add(ingredient.localize());
41 | }
42 | return tooltip;
43 | }
44 |
45 | @Override
46 | public FontRenderer getFontRenderer(Minecraft minecraft, DCAirflow ingredient) {
47 | return minecraft.fontRenderer;
48 | }
49 |
50 | }
51 |
--------------------------------------------------------------------------------
/main/java/defeatedcrow/hac/asm/DCASMPlugin.java:
--------------------------------------------------------------------------------
1 | package defeatedcrow.hac.asm;
2 |
3 | import java.io.File;
4 | import java.util.Map;
5 |
6 | import net.minecraftforge.common.config.Configuration;
7 | import net.minecraftforge.fml.relauncher.IFMLLoadingPlugin;
8 | import net.minecraftforge.fml.relauncher.IFMLLoadingPlugin.MCVersion;
9 |
10 | @MCVersion("1.12.2")
11 | public class DCASMPlugin implements IFMLLoadingPlugin {
12 |
13 | static File file;
14 |
15 | @Override
16 | public String[] getASMTransformerClass() {
17 | return new String[] { "defeatedcrow.hac.asm.DCMethodTransformer" };
18 | }
19 |
20 | @Override
21 | public String getModContainerClass() {
22 | return "defeatedcrow.hac.asm.DCASMCore";
23 | }
24 |
25 | @Override
26 | public String getSetupClass() {
27 | return null;
28 | }
29 |
30 | @Override
31 | public void injectData(Map data) {
32 | if (data.containsKey("mcLocation")) {
33 | file = (File) data.get("mcLocation");
34 | }
35 |
36 | if (file != null) {
37 | File config = new File(file, "config/defeatedcrow/climate/dcs_asm.cfg");
38 | loadConfig(config);
39 | // LOGGER.debug("loaded config:" + config.toPath().toString());
40 | } else {
41 | // LOGGER.debug("failed to load config");
42 | }
43 | }
44 |
45 | @Override
46 | public String getAccessTransformerClass() {
47 | return null;
48 | }
49 |
50 | private void loadConfig(File configFile) {
51 | ClimateAsmConfig.INSTANCE.load(new Configuration(configFile));
52 | }
53 | }
54 |
--------------------------------------------------------------------------------
/main/java/defeatedcrow/hac/core/climate/ClimateHelper.java:
--------------------------------------------------------------------------------
1 | package defeatedcrow.hac.core.climate;
2 |
3 | import defeatedcrow.hac.api.climate.ClimateAPI;
4 | import defeatedcrow.hac.api.climate.DCAirflow;
5 | import defeatedcrow.hac.api.climate.DCHeatTier;
6 | import defeatedcrow.hac.api.climate.DCHumidity;
7 | import defeatedcrow.hac.api.climate.IClimate;
8 | import defeatedcrow.hac.api.climate.IClimateHelper;
9 | import net.minecraft.nbt.NBTTagCompound;
10 |
11 | public class ClimateHelper implements IClimateHelper {
12 |
13 | public static final String NBT_KEY = "dcs.climate";
14 |
15 | @Override
16 | public IClimate getClimateFromInt(int code) {
17 | return ClimateAPI.register.getClimateFromInt(code);
18 | }
19 |
20 | @Override
21 | public IClimate getClimateFromParam(DCHeatTier heat, DCHumidity hum, DCAirflow air) {
22 | return ClimateAPI.register.getClimateFromParam(heat, hum, air);
23 | }
24 |
25 | @Override
26 | public IClimate getClimateFromNBT(NBTTagCompound nbt) {
27 | if (nbt != null && nbt.hasKey(NBT_KEY)) {
28 | int i = nbt.getInteger(NBT_KEY);
29 | IClimate climate = getClimateFromInt(i);
30 | return climate;
31 | }
32 | return null;
33 | }
34 |
35 | @Override
36 | public void setClimateToNBT(NBTTagCompound nbt, IClimate climate) {
37 | if (nbt != null && climate != null) {
38 | int i = climate.getClimateInt();
39 | nbt.setInteger(NBT_KEY, i);
40 | }
41 | }
42 |
43 | @Override
44 | public String getNBTKey() {
45 | return NBT_KEY;
46 | }
47 |
48 | }
49 |
--------------------------------------------------------------------------------
/main/java/defeatedcrow/hac/core/plugin/jei/ingredients/HumidityRenderer.java:
--------------------------------------------------------------------------------
1 | package defeatedcrow.hac.core.plugin.jei.ingredients;
2 |
3 | import java.util.ArrayList;
4 | import java.util.List;
5 |
6 | import defeatedcrow.hac.api.climate.DCHumidity;
7 | import mezz.jei.api.ingredients.IIngredientRenderer;
8 | import net.minecraft.client.Minecraft;
9 | import net.minecraft.client.gui.FontRenderer;
10 | import net.minecraft.client.util.ITooltipFlag;
11 |
12 | public class HumidityRenderer implements IIngredientRenderer {
13 | private final int width;
14 | private final int height;
15 | private final boolean show;
16 |
17 | public HumidityRenderer() {
18 | this(false, 16, 16);
19 | }
20 |
21 | public HumidityRenderer(int w, int h) {
22 | this(true, w, h);
23 | }
24 |
25 | public HumidityRenderer(boolean s, int w, int h) {
26 | show = s;
27 | width = w;
28 | height = h;
29 | }
30 |
31 | @Override
32 | public void render(Minecraft minecraft, int xPosition, int yPosition, DCHumidity ingredient) {
33 | return;
34 | }
35 |
36 | @Override
37 | public List getTooltip(Minecraft minecraft, DCHumidity ingredient, ITooltipFlag tooltipFlag) {
38 | List tooltip = new ArrayList();
39 | if (ingredient != null) {
40 | tooltip.add(ingredient.localize());
41 | }
42 | return tooltip;
43 | }
44 |
45 | @Override
46 | public FontRenderer getFontRenderer(Minecraft minecraft, DCHumidity ingredient) {
47 | return minecraft.fontRenderer;
48 | }
49 |
50 | }
51 |
--------------------------------------------------------------------------------
/main/java/defeatedcrow/hac/core/CreativeTabClimate.java:
--------------------------------------------------------------------------------
1 | package defeatedcrow.hac.core;
2 |
3 | import java.util.List;
4 |
5 | import com.google.common.collect.Lists;
6 |
7 | import net.minecraft.block.Block;
8 | import net.minecraft.creativetab.CreativeTabs;
9 | import net.minecraft.item.Item;
10 | import net.minecraft.item.ItemStack;
11 | import net.minecraft.util.NonNullList;
12 | import net.minecraftforge.fml.relauncher.Side;
13 | import net.minecraftforge.fml.relauncher.SideOnly;
14 |
15 | public class CreativeTabClimate extends CreativeTabs {
16 |
17 | // クリエイティブタブのアイコン画像や名称の登録クラス
18 | public CreativeTabClimate(String type) {
19 | super(type);
20 | }
21 |
22 | @Override
23 | @SideOnly(Side.CLIENT)
24 | public String getTranslatedTabLabel() {
25 | return "HeatAndClimate";
26 | }
27 |
28 | @Override
29 | public ItemStack getTabIconItem() {
30 | return new ItemStack(DCInit.climate_checker);
31 | }
32 |
33 | @Override
34 | @SideOnly(Side.CLIENT)
35 | public void displayAllRelevantItems(NonNullList list) {
36 | for (Item item : subItems) {
37 | item.getSubItems(this, list);
38 | }
39 | }
40 |
41 | private List- subItems = Lists.newArrayList();
42 |
43 | public void addSubItem(Item item) {
44 | if (item != null) {
45 | item.setCreativeTab(this);
46 | subItems.add(item);
47 | }
48 | }
49 |
50 | public void addSubItem(Block block) {
51 | if (block != null) {
52 | block.setCreativeTab(this);
53 | subItems.add(Item.getItemFromBlock(block));
54 | }
55 | }
56 |
57 | }
58 |
--------------------------------------------------------------------------------
/main/java/defeatedcrow/hac/core/client/base/ContainerBaseDC.java:
--------------------------------------------------------------------------------
1 | package defeatedcrow.hac.core.client.base;
2 |
3 | import defeatedcrow.hac.core.util.DCUtil;
4 | import net.minecraft.entity.player.EntityPlayer;
5 | import net.minecraft.inventory.Container;
6 | import net.minecraft.inventory.Slot;
7 | import net.minecraft.item.ItemStack;
8 |
9 | public abstract class ContainerBaseDC extends Container {
10 |
11 | protected abstract int inputMinIndex();
12 |
13 | protected abstract int inputMaxIndex();
14 |
15 | protected abstract int slotIndex();
16 |
17 | @Override
18 | public ItemStack transferStackInSlot(EntityPlayer playerIn, int index) {
19 | ItemStack itemstack = ItemStack.EMPTY;
20 | Slot slot = this.inventorySlots.get(index);
21 |
22 | if (slot != null && slot.getHasStack()) {
23 | ItemStack itemstack1 = slot.getStack();
24 | itemstack = itemstack1.copy();
25 |
26 | if (index < slotIndex()) {
27 | if (!this.mergeItemStack(itemstack1, slotIndex(), slotIndex() + 35, true))
28 | return ItemStack.EMPTY;
29 | slot.onSlotChange(itemstack1, itemstack);
30 | } else {
31 | if (!this.mergeItemStack(itemstack1, inputMinIndex(), inputMaxIndex(), false))
32 | return ItemStack.EMPTY;
33 | }
34 |
35 | if (!DCUtil.isEmpty(itemstack1)) {
36 | slot.onSlotChanged();
37 | }
38 |
39 | if (itemstack1.getCount() == itemstack.getCount()) {
40 | return ItemStack.EMPTY;
41 | }
42 |
43 | slot.onTake(playerIn, itemstack1);
44 | }
45 |
46 | return itemstack;
47 | }
48 |
49 | }
50 |
--------------------------------------------------------------------------------
/main/java/defeatedcrow/hac/core/plugin/jei/ingredients/HeatTierRenderer.java:
--------------------------------------------------------------------------------
1 | package defeatedcrow.hac.core.plugin.jei.ingredients;
2 |
3 | import java.util.ArrayList;
4 | import java.util.List;
5 |
6 | import defeatedcrow.hac.api.climate.DCHeatTier;
7 | import mezz.jei.api.ingredients.IIngredientRenderer;
8 | import net.minecraft.client.Minecraft;
9 | import net.minecraft.client.gui.FontRenderer;
10 | import net.minecraft.client.util.ITooltipFlag;
11 |
12 | public class HeatTierRenderer implements IIngredientRenderer {
13 | private final int width;
14 | private final int height;
15 | private final boolean show;
16 |
17 | public HeatTierRenderer() {
18 | this(false, 16, 16);
19 | }
20 |
21 | public HeatTierRenderer(int w, int h) {
22 | this(true, w, h);
23 | }
24 |
25 | public HeatTierRenderer(boolean s, int w, int h) {
26 | show = s;
27 | width = w;
28 | height = h;
29 | }
30 |
31 | @Override
32 | public void render(Minecraft minecraft, int xPosition, int yPosition, DCHeatTier ingredient) {
33 | return;
34 | }
35 |
36 | @Override
37 | public List getTooltip(Minecraft minecraft, DCHeatTier ingredient, ITooltipFlag tooltipFlag) {
38 | List tooltip = new ArrayList();
39 | if (ingredient != null) {
40 | tooltip.add(ingredient.localize() + " " + ingredient.getTemp());
41 | }
42 | return tooltip;
43 | }
44 |
45 | @Override
46 | public FontRenderer getFontRenderer(Minecraft minecraft, DCHeatTier ingredient) {
47 | return minecraft.fontRenderer;
48 | }
49 |
50 | }
51 |
--------------------------------------------------------------------------------
/main/java/defeatedcrow/hac/core/plugin/jei/FluidRecipeHandler.java:
--------------------------------------------------------------------------------
1 | package defeatedcrow.hac.core.plugin.jei;
2 |
3 | import java.util.List;
4 |
5 | import defeatedcrow.hac.core.climate.recipe.FluidCraftRecipe;
6 | import mezz.jei.api.recipe.IRecipeHandler;
7 | import mezz.jei.api.recipe.IRecipeWrapper;
8 |
9 | @Deprecated
10 | public class FluidRecipeHandler implements IRecipeHandler {
11 |
12 | @Override
13 | public Class getRecipeClass() {
14 | return FluidCraftRecipe.class;
15 | }
16 |
17 | public String getRecipeCategoryUid() {
18 | return "dcs_climate.fluidcraft";
19 | }
20 |
21 | @Override
22 | public IRecipeWrapper getRecipeWrapper(FluidCraftRecipe recipe) {
23 | return new FluidRecipeWrapper(recipe);
24 | }
25 |
26 | @Override
27 | public boolean isRecipeValid(FluidCraftRecipe recipe) {
28 | if (recipe.getProcessedInput() != null && !recipe.getProcessedInput().isEmpty()) {
29 | if (recipe.getProcessedInput().size() > 3) {
30 | return false;
31 | }
32 | boolean ret = true;
33 | for (Object obj : recipe.getProcessedInput()) {
34 | if (obj instanceof List) {
35 | if (((List) obj).isEmpty())
36 | ret = false;
37 | } else if (obj == null) {
38 | ret = false;
39 | }
40 | }
41 | return ret;
42 | } else if (recipe.getInputFluid() != null) {
43 | return true;
44 | }
45 | return false;
46 | }
47 |
48 | @Override
49 | public String getRecipeCategoryUid(FluidCraftRecipe recipe) {
50 | return getRecipeCategoryUid();
51 | }
52 |
53 | }
54 |
--------------------------------------------------------------------------------
/main/java/defeatedcrow/hac/core/plugin/jei/ReactorRecipeHandler.java:
--------------------------------------------------------------------------------
1 | package defeatedcrow.hac.core.plugin.jei;
2 |
3 | import java.util.List;
4 |
5 | import defeatedcrow.hac.core.climate.recipe.ReactorRecipe;
6 | import mezz.jei.api.recipe.IRecipeHandler;
7 | import mezz.jei.api.recipe.IRecipeWrapper;
8 |
9 | @Deprecated
10 | public class ReactorRecipeHandler implements IRecipeHandler {
11 |
12 | @Override
13 | public Class getRecipeClass() {
14 | return ReactorRecipe.class;
15 | }
16 |
17 | public String getRecipeCategoryUid() {
18 | return "dcs_climate.reactor";
19 | }
20 |
21 | @Override
22 | public IRecipeWrapper getRecipeWrapper(ReactorRecipe recipe) {
23 | return new ReactorRecipeWrapper(recipe);
24 | }
25 |
26 | @Override
27 | public boolean isRecipeValid(ReactorRecipe recipe) {
28 | if (recipe.getProcessedInput() != null && !recipe.getProcessedInput().isEmpty()) {
29 | if (recipe.getProcessedInput().size() > 4) {
30 | return false;
31 | }
32 | boolean ret = true;
33 | for (Object obj : recipe.getProcessedInput()) {
34 | if (obj instanceof List) {
35 | if (((List) obj).isEmpty())
36 | ret = false;
37 | } else if (obj == null) {
38 | ret = false;
39 | }
40 | }
41 | return ret;
42 | } else if (recipe.getInputFluid() != null || recipe.getSubInputFluid() != null) {
43 | return true;
44 | }
45 | return false;
46 | }
47 |
48 | @Override
49 | public String getRecipeCategoryUid(ReactorRecipe recipe) {
50 | return getRecipeCategoryUid();
51 | }
52 |
53 | }
54 |
--------------------------------------------------------------------------------
/main/java/defeatedcrow/hac/core/packet/HaCPacket.java:
--------------------------------------------------------------------------------
1 | package defeatedcrow.hac.core.packet;
2 |
3 | import defeatedcrow.hac.core.packet.command.MHandlerComConfig;
4 | import defeatedcrow.hac.core.packet.command.MHandlerComDrought;
5 | import defeatedcrow.hac.core.packet.command.MHandlerComSeason;
6 | import defeatedcrow.hac.core.packet.command.MessageComConfig;
7 | import defeatedcrow.hac.core.packet.command.MessageComDrought;
8 | import defeatedcrow.hac.core.packet.command.MessageComSeason;
9 | import net.minecraftforge.fml.common.network.NetworkRegistry;
10 | import net.minecraftforge.fml.common.network.simpleimpl.SimpleNetworkWrapper;
11 | import net.minecraftforge.fml.relauncher.Side;
12 |
13 | public class HaCPacket {
14 |
15 | public static final SimpleNetworkWrapper INSTANCE = NetworkRegistry.INSTANCE.newSimpleChannel("dcs_climate");
16 |
17 | public static void init() {
18 | INSTANCE.registerMessage(MHandlerCharmKey.class, MessageCharmKey.class, 0, Side.SERVER);
19 | INSTANCE.registerMessage(MHandlerTorqueTile.class, MessageTorqueTile.class, 1, Side.CLIENT);
20 | INSTANCE.registerMessage(MHandlerClimateTile.class, MessageClimateUpdate.class, 2, Side.CLIENT);
21 | INSTANCE.registerMessage(MHandlerWeatherUpdate.class, MessageWeatherUpdate.class, 3, Side.CLIENT);
22 |
23 | INSTANCE.registerMessage(MHandlerComSeason.class, MessageComSeason.class, 4, Side.CLIENT);
24 | INSTANCE.registerMessage(MHandlerComDrought.class, MessageComDrought.class, 5, Side.CLIENT);
25 | INSTANCE.registerMessage(MHandlerComConfig.class, MessageComConfig.class, 6, Side.CLIENT);
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/main/java/defeatedcrow/hac/core/climate/ThermalInsulationUtil.java:
--------------------------------------------------------------------------------
1 | package defeatedcrow.hac.core.climate;
2 |
3 | import java.util.HashMap;
4 | import java.util.Map;
5 |
6 | import defeatedcrow.hac.api.climate.IThermalInsulationBlock;
7 | import net.minecraft.block.Block;
8 | import net.minecraft.block.material.Material;
9 | import net.minecraft.block.state.IBlockState;
10 | import net.minecraft.init.Blocks;
11 | import net.minecraft.util.math.BlockPos;
12 | import net.minecraft.world.World;
13 |
14 | public class ThermalInsulationUtil {
15 |
16 | public static int getInsulation(World world, BlockPos pos) {
17 | IBlockState state = world.getBlockState(pos);
18 | if (state != null && state.isOpaqueCube()) {
19 | if (state.getBlock() instanceof IThermalInsulationBlock) {
20 | return ((IThermalInsulationBlock) state.getBlock()).getReductionAmount(world, pos, state);
21 | } else {
22 | if (!BLOCK_MAP.isEmpty() && BLOCK_MAP.containsKey(state.getBlock())) {
23 | int i = BLOCK_MAP.get(state.getBlock());
24 | return i;
25 | } else if (state.getMaterial() == Material.WOOD || state.getMaterial() == Material.CLOTH) {
26 | return 1;
27 | }
28 | }
29 | }
30 | return 0;
31 | }
32 |
33 | public static final Map BLOCK_MAP = new HashMap();
34 |
35 | public static void load() {
36 | BLOCK_MAP.put(Blocks.BRICK_BLOCK, 2);
37 | BLOCK_MAP.put(Blocks.NETHER_BRICK, 2);
38 | BLOCK_MAP.put(Blocks.STAINED_HARDENED_CLAY, 2);
39 | BLOCK_MAP.put(Blocks.HARDENED_CLAY, 2);
40 | BLOCK_MAP.put(Blocks.SPONGE, 2);
41 | }
42 |
43 | }
44 |
--------------------------------------------------------------------------------
/main/java/defeatedcrow/hac/core/plugin/jei/SpinningRecipeWrapper.java:
--------------------------------------------------------------------------------
1 | package defeatedcrow.hac.core.plugin.jei;
2 |
3 | import java.util.ArrayList;
4 | import java.util.List;
5 |
6 | import defeatedcrow.hac.api.recipe.ISpinningRecipe;
7 | import mezz.jei.api.ingredients.IIngredients;
8 | import mezz.jei.api.ingredients.VanillaTypes;
9 | import mezz.jei.api.recipe.IRecipeWrapper;
10 | import net.minecraft.client.Minecraft;
11 | import net.minecraft.item.ItemStack;
12 |
13 | public class SpinningRecipeWrapper implements IRecipeWrapper {
14 |
15 | private final List input;
16 | private final List output;
17 | private final ISpinningRecipe rec;
18 |
19 | public SpinningRecipeWrapper(ISpinningRecipe recipe) {
20 | rec = recipe;
21 | input = recipe.getProcessedInput();
22 | output = new ArrayList();
23 | output.add(recipe.getOutput());
24 | }
25 |
26 | @Override
27 | public void getIngredients(IIngredients ing) {
28 | ing.setInputs(VanillaTypes.ITEM, input);
29 | ing.setOutputs(VanillaTypes.ITEM, output);
30 | }
31 |
32 | public List getInputs() {
33 | return input;
34 | }
35 |
36 | public List getOutputs() {
37 | return output;
38 | }
39 |
40 | @Override
41 | public void drawInfo(Minecraft mc, int wid, int hei, int mouseX, int mouseY) {}
42 |
43 | @Override
44 | public boolean handleClick(Minecraft minecraft, int mouseX, int mouseY, int mouseButton) {
45 | return false;
46 | }
47 |
48 | @Override
49 | public List getTooltipStrings(int mouseX, int mouseY) {
50 | return null;
51 | }
52 |
53 | }
54 |
--------------------------------------------------------------------------------
/main/java/defeatedcrow/hac/api/climate/ItemSet.java:
--------------------------------------------------------------------------------
1 | package defeatedcrow.hac.api.climate;
2 |
3 | import net.minecraft.item.Item;
4 | import net.minecraft.item.ItemStack;
5 |
6 | /**
7 | * Item、metaのセット
8 | * ItemStackではMapのキーにならないので面倒くさい
9 | */
10 | public class ItemSet {
11 |
12 | public final Item item;
13 | public final int meta;
14 | public static final ItemSet EMPTY = new ItemSet(null, 0);
15 |
16 | public ItemSet(Item i, int j) {
17 | item = i;
18 | meta = j;
19 | }
20 |
21 | public ItemSet(Item i) {
22 | item = i;
23 | meta = 0;
24 | }
25 |
26 | public ItemSet(ItemStack stack) {
27 | item = stack.getItem();
28 | meta = stack.getItemDamage();
29 | }
30 |
31 | public static boolean isEmpty(ItemSet set) {
32 | if (set == null || set.item == null)
33 | return true;
34 | return false;
35 | }
36 |
37 | public ItemStack getSingleStack() {
38 | if (item == null)
39 | return ItemStack.EMPTY;
40 | return new ItemStack(item, 1, meta);
41 | }
42 |
43 | public String localizedname() {
44 | if (item == null)
45 | return "empty";
46 | return getSingleStack().getDisplayName();
47 | }
48 |
49 | /**
50 | * metaにはwildcard指定可能
51 | */
52 | @Override
53 | public boolean equals(Object obj) {
54 | if (obj != null && obj instanceof ItemSet) {
55 | ItemSet p = (ItemSet) obj;
56 | return p.item == item && (meta == 32767 || p.meta == 32767 || p.meta == meta);
57 | }
58 | return super.equals(obj);
59 | }
60 |
61 | @Override
62 | public int hashCode() {
63 | if (item == null)
64 | return 0;
65 | int i = item.getUnlocalizedName().hashCode() + meta;
66 | return i;
67 | }
68 | }
69 |
--------------------------------------------------------------------------------
/main/java/defeatedcrow/hac/api/climate/WorldHeatTierEvent.java:
--------------------------------------------------------------------------------
1 | package defeatedcrow.hac.api.climate;
2 |
3 | import net.minecraft.util.math.BlockPos;
4 | import net.minecraft.world.World;
5 | import net.minecraftforge.common.MinecraftForge;
6 | import net.minecraftforge.fml.common.eventhandler.Event;
7 | import net.minecraftforge.fml.common.eventhandler.Event.HasResult;
8 |
9 | /**
10 | * BiomeのHeatTier参照時のイベント。
11 | * Result.ALLOWの場合、結果を変更できる
12 | */
13 | @HasResult
14 | public class WorldHeatTierEvent extends Event {
15 |
16 | private final World world;
17 | private final BlockPos pos;
18 | private final DCHeatTier prevTier;
19 | private DCHeatTier newTier;
20 | private final EventType type;
21 |
22 | public WorldHeatTierEvent(World worldIn, BlockPos posIn, DCHeatTier prev, boolean isHeat) {
23 | this.pos = posIn;
24 | this.world = worldIn;
25 | this.prevTier = prev;
26 | this.newTier = prev;
27 | type = isHeat ? EventType.HOT : EventType.COLD;
28 | }
29 |
30 | public DCHeatTier result() {
31 | MinecraftForge.EVENT_BUS.post(this);
32 | if (hasResult() && getResult() == Result.ALLOW) {
33 | return newTier;
34 | }
35 |
36 | return prevTier;
37 | }
38 |
39 | public World getWorld() {
40 | return world;
41 | }
42 |
43 | public BlockPos getPos() {
44 | return pos;
45 | }
46 |
47 | public DCHeatTier currentClimate() {
48 | return prevTier;
49 | }
50 |
51 | public EventType getType() {
52 | return type;
53 | }
54 |
55 | public void setNewClimate(DCHeatTier tier) {
56 | if (tier != null)
57 | newTier = tier;
58 | }
59 |
60 | public static enum EventType {
61 | HOT,
62 | COLD;
63 | }
64 | }
65 |
--------------------------------------------------------------------------------
/main/java/defeatedcrow/hac/api/climate/BlockHeatTierEvent.java:
--------------------------------------------------------------------------------
1 | package defeatedcrow.hac.api.climate;
2 |
3 | import net.minecraft.util.math.BlockPos;
4 | import net.minecraft.world.World;
5 | import net.minecraftforge.common.MinecraftForge;
6 | import net.minecraftforge.fml.common.eventhandler.Event;
7 | import net.minecraftforge.fml.common.eventhandler.Event.HasResult;
8 |
9 | /**
10 | * 各BlockのHeatTier参照時に発火するイベント。
11 | * Result.ALLOWの場合、結果を変更できる
12 | */
13 | @HasResult
14 | public class BlockHeatTierEvent extends Event {
15 |
16 | private final World world;
17 | private final BlockPos pos;
18 | private final DCHeatTier prevTier;
19 | private DCHeatTier newTier;
20 | private final EventType type;
21 |
22 | public BlockHeatTierEvent(World worldIn, BlockPos posIn, DCHeatTier prev, boolean isHeat) {
23 | this.pos = posIn;
24 | this.world = worldIn;
25 | this.prevTier = prev;
26 | this.newTier = prev;
27 | type = isHeat ? EventType.HOT : EventType.COLD;
28 | }
29 |
30 | public DCHeatTier result() {
31 | MinecraftForge.EVENT_BUS.post(this);
32 | if (hasResult() && getResult() == Result.ALLOW) {
33 | return newTier;
34 | }
35 |
36 | return prevTier;
37 | }
38 |
39 | public World getWorld() {
40 | return world;
41 | }
42 |
43 | public BlockPos getPos() {
44 | return pos;
45 | }
46 |
47 | public DCHeatTier currentClimate() {
48 | return prevTier;
49 | }
50 |
51 | public EventType getType() {
52 | return type;
53 | }
54 |
55 | public void setNewClimate(DCHeatTier tier) {
56 | if (tier != null)
57 | newTier = tier;
58 | }
59 |
60 | public static enum EventType {
61 | HOT,
62 | COLD;
63 | }
64 | }
65 |
--------------------------------------------------------------------------------
/main/java/defeatedcrow/hac/core/packet/command/MHandlerComSeason.java:
--------------------------------------------------------------------------------
1 | package defeatedcrow.hac.core.packet.command;
2 |
3 | import defeatedcrow.hac.api.climate.EnumSeason;
4 | import defeatedcrow.hac.core.ClimateCore;
5 | import net.minecraft.world.World;
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 MHandlerComSeason implements IMessageHandler {
12 |
13 | @Override
14 | // IMessageHandlerのメソッド
15 | public IMessage onMessage(MessageComSeason message, MessageContext ctx) {
16 | if (ctx != null && ctx.side == Side.CLIENT) {
17 | int data = message.data;
18 | EnumSeason season = null;
19 | if (data == 0) {
20 | season = EnumSeason.SPRING;
21 | } else if (data == 1) {
22 | season = EnumSeason.SUMMER;
23 | } else if (data == 2) {
24 | season = EnumSeason.AUTUMN;
25 | } else if (data == 3) {
26 | season = EnumSeason.WINTER;
27 | }
28 | World world = ClimateCore.proxy.getClientWorld();
29 | if (world != null && world.hasCapability(CapabilityForcedSeason.FORCED_SEASON_CAPABILITY, null)) {
30 | IForcedSeason cap = world.getCapability(CapabilityForcedSeason.FORCED_SEASON_CAPABILITY, null);
31 | if (season == null) {
32 | cap.setForced(false);
33 | cap.setForcedSeason(EnumSeason.SPRING);
34 | } else {
35 | cap.setForced(true);
36 | cap.setForcedSeason(season);
37 | }
38 | }
39 | }
40 | return null;
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/main/java/defeatedcrow/hac/api/climate/BlockSet.java:
--------------------------------------------------------------------------------
1 | package defeatedcrow.hac.api.climate;
2 |
3 | import net.minecraft.block.Block;
4 | import net.minecraft.block.state.IBlockState;
5 | import net.minecraft.init.Blocks;
6 | import net.minecraft.item.Item;
7 | import net.minecraft.item.ItemStack;
8 |
9 | /** ItemStackのようなBlock、metaのセットが欲しかったので作成 */
10 | public final class BlockSet {
11 |
12 | public final Block block;
13 | public final int meta;
14 |
15 | public BlockSet(Block i, int j) {
16 | block = i;
17 | meta = j;
18 | }
19 |
20 | public IBlockState getState() {
21 | return block == null ? Blocks.AIR.getDefaultState() : meta == 32767 ? block.getDefaultState() : block
22 | .getStateFromMeta(meta);
23 | }
24 |
25 | public ItemStack getSingleStack() {
26 | if (block == null)
27 | return ItemStack.EMPTY;
28 | return new ItemStack(Item.getItemFromBlock(block), 1, meta);
29 | }
30 |
31 | /**
32 | * metaにはwildcard指定可能
33 | */
34 | @Override
35 | public boolean equals(Object obj) {
36 | if (obj != null && obj instanceof BlockSet) {
37 | BlockSet p = (BlockSet) obj;
38 | return p.block == block && (meta == 32767 || p.meta == 32767 || p.meta == meta);
39 | }
40 | return super.equals(obj);
41 | }
42 |
43 | @Override
44 | public int hashCode() {
45 | if (block == null)
46 | return 0;
47 | int i = block.getUnlocalizedName().hashCode() + meta;
48 | return i;
49 | }
50 |
51 | @Override
52 | public String toString() {
53 | String name = block == null ? "null" : block.getRegistryName().toString();
54 | return name + ":" + meta;
55 | }
56 |
57 | public static final BlockSet AIR = new BlockSet(Blocks.AIR, 0);
58 | }
59 |
--------------------------------------------------------------------------------
/main/java/defeatedcrow/hac/core/event/CoreAnvilEvent.java:
--------------------------------------------------------------------------------
1 | package defeatedcrow.hac.core.event;
2 |
3 | import defeatedcrow.hac.api.item.IAnvilTool;
4 | import defeatedcrow.hac.api.item.IPlatingTool;
5 | import defeatedcrow.hac.core.util.DCUtil;
6 | import net.minecraft.item.ItemStack;
7 | import net.minecraftforge.event.AnvilUpdateEvent;
8 | import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
9 |
10 | public class CoreAnvilEvent {
11 |
12 | @SubscribeEvent
13 | public void onAnvilUpdate(AnvilUpdateEvent event) {
14 | ItemStack left = event.getLeft();
15 | ItemStack right = event.getRight();
16 | ItemStack ret = event.getOutput();
17 | /* Plating */
18 | if (!DCUtil.isEmpty(right) && !DCUtil.isEmpty(left) && DCUtil.isEmpty(ret)) {
19 | if (right.getItem() instanceof IPlatingTool) {
20 | IPlatingTool tool = (IPlatingTool) right.copy().getItem();
21 | if (tool.canEnchant(left, right)) {
22 | ItemStack result = tool.getEnchantedItem(left, right);
23 | if (!DCUtil.isEmpty(result)) {
24 | event.setOutput(result);
25 | event.setMaterialCost(1);
26 | event.setCost(3);
27 | }
28 | }
29 | }
30 | } else if (right.getItem() instanceof IAnvilTool) {
31 | IAnvilTool tool = (IAnvilTool) right.copy().getItem();
32 | if (tool.canEnhance(left, right) && right.getCount() >= tool.getMaterialCost(right.getItemDamage())) {
33 | ItemStack result = tool.getEnhancedItem(left, right);
34 | if (!DCUtil.isEmpty(result)) {
35 | event.setOutput(result);
36 | event.setMaterialCost(tool.getMaterialCost(right.getItemDamage()));
37 | event.setCost(tool.getCost(right.getItemDamage()));
38 | }
39 | }
40 | }
41 | }
42 |
43 | }
44 |
--------------------------------------------------------------------------------
/main/resources/assets/dcs_climate/models/block/dcs_ore.json:
--------------------------------------------------------------------------------
1 | {
2 | "parent": "block/block",
3 | "textures": {
4 | "particle": "#ore"
5 | },
6 | "elements": [
7 | { "from": [ 0, 0, 0 ],
8 | "to": [ 16, 16, 16 ],
9 | "faces": {
10 | "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#stone", "cullface": "down" },
11 | "up": { "uv": [ 0, 0, 16, 16 ], "texture": "#stone", "cullface": "up" },
12 | "north": { "uv": [ 0, 0, 16, 16 ], "texture": "#stone", "cullface": "north" },
13 | "south": { "uv": [ 0, 0, 16, 16 ], "texture": "#stone", "cullface": "south" },
14 | "west": { "uv": [ 0, 0, 16, 16 ], "texture": "#stone", "cullface": "west" },
15 | "east": { "uv": [ 0, 0, 16, 16 ], "texture": "#stone", "cullface": "east" }
16 | }
17 | },
18 | { "from": [ 0, 0, 0 ],
19 | "to": [ 16, 16, 16 ],
20 | "faces": {
21 | "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#ore", "tintindex": 0 , "cullface": "down" },
22 | "up": { "uv": [ 0, 0, 16, 16 ], "texture": "#ore", "tintindex": 0 , "cullface": "up" },
23 | "north": { "uv": [ 0, 0, 16, 16 ], "texture": "#ore", "tintindex": 0 , "cullface": "north" },
24 | "south": { "uv": [ 0, 0, 16, 16 ], "texture": "#ore", "tintindex": 0 , "cullface": "south" },
25 | "west": { "uv": [ 0, 0, 16, 16 ], "texture": "#ore", "tintindex": 0 , "cullface": "west" },
26 | "east": { "uv": [ 0, 0, 16, 16 ], "texture": "#ore", "tintindex": 0 , "cullface": "east" }
27 | }
28 | }
29 | ]
30 | }
--------------------------------------------------------------------------------
/main/resources/assets/dcs_climate/models/block/dcs_cube_lamp.json:
--------------------------------------------------------------------------------
1 | {
2 | "parent": "block/block",
3 | "ambientocclusion": false,
4 | "textures": {
5 | "particle": "#glass"
6 | },
7 | "elements": [
8 | { "from": [ 3, 3, 3 ],
9 | "to": [ 13, 13, 13 ],
10 | "shade": false,
11 | "faces": {
12 | "down": { "uv": [ 1, 1, 15, 15 ], "texture": "#inner", "cullface": "down" },
13 | "up": { "uv": [ 1, 1, 15, 15 ], "texture": "#inner", "cullface": "up" },
14 | "north": { "uv": [ 1, 1, 15, 15 ], "texture": "#inner", "cullface": "north" },
15 | "south": { "uv": [ 1, 1, 15, 15 ], "texture": "#inner", "cullface": "south" },
16 | "west": { "uv": [ 1, 1, 15, 15 ], "texture": "#inner", "cullface": "west" },
17 | "east": { "uv": [ 1, 1, 15, 15 ], "texture": "#inner", "cullface": "east" }
18 | }
19 | },
20 | { "from": [ 0, 0, 0 ],
21 | "to": [ 16, 16, 16 ],
22 | "shade": false,
23 | "faces": {
24 | "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#glass", "cullface": "down" },
25 | "up": { "uv": [ 0, 0, 16, 16 ], "texture": "#glass", "cullface": "up" },
26 | "north": { "uv": [ 0, 0, 16, 16 ], "texture": "#glass", "cullface": "north" },
27 | "south": { "uv": [ 0, 0, 16, 16 ], "texture": "#glass", "cullface": "south" },
28 | "west": { "uv": [ 0, 0, 16, 16 ], "texture": "#glass", "cullface": "west" },
29 | "east": { "uv": [ 0, 0, 16, 16 ], "texture": "#glass", "cullface": "east" }
30 | }
31 | }
32 | ]
33 | }
--------------------------------------------------------------------------------
/main/java/defeatedcrow/hac/core/plugin/DCsJEIPluginLists.java:
--------------------------------------------------------------------------------
1 | package defeatedcrow.hac.core.plugin;
2 |
3 | import java.util.ArrayList;
4 | import java.util.List;
5 |
6 | import defeatedcrow.hac.core.plugin.jei.ClimateEffectiveTile;
7 | import net.minecraft.item.ItemStack;
8 |
9 | public class DCsJEIPluginLists {
10 |
11 | public static final DCsJEIPluginLists INSTANCE = new DCsJEIPluginLists();
12 |
13 | private DCsJEIPluginLists() {}
14 |
15 | public static final List millstones = new ArrayList<>();
16 | public static final List fluidcrafters = new ArrayList<>();
17 |
18 | public static final List crops = new ArrayList<>();
19 | public static final List spinning = new ArrayList<>();
20 | public static final List crusher = new ArrayList<>();
21 | public static final List crusher_sus = new ArrayList<>();
22 | public static final List crusher_ti = new ArrayList<>();
23 | public static final List crusher_sc = new ArrayList<>();
24 |
25 | public static final List excluder = new ArrayList<>();
26 |
27 | public static final List climate = new ArrayList<>();
28 | public static final List climateIcons = new ArrayList<>();
29 |
30 | public static final List fluidcrafters_steel = new ArrayList<>();
31 | public static final List fluidcrafters_pot = new ArrayList<>();
32 | public static final List fluidcrafters_drink = new ArrayList<>();
33 | public static final List fluidcrafters_skillet = new ArrayList<>();
34 |
35 | public static final List reactors = new ArrayList<>();
36 | public static final List reactors_simple = new ArrayList<>();
37 |
38 | }
39 |
--------------------------------------------------------------------------------
/main/java/defeatedcrow/hac/api/cultivate/IClimateCrop.java:
--------------------------------------------------------------------------------
1 | package defeatedcrow.hac.api.cultivate;
2 |
3 | import java.util.List;
4 |
5 | import defeatedcrow.hac.api.climate.DCAirflow;
6 | import defeatedcrow.hac.api.climate.DCHeatTier;
7 | import defeatedcrow.hac.api.climate.DCHumidity;
8 | import defeatedcrow.hac.api.climate.IClimate;
9 | import net.minecraft.block.state.IBlockState;
10 | import net.minecraft.entity.player.EntityPlayer;
11 | import net.minecraft.item.ItemStack;
12 | import net.minecraft.util.math.BlockPos;
13 | import net.minecraft.world.World;
14 |
15 | /**
16 | * Climate利用作物
17 | * Blockクラスに継承する。Entityに対応できるかは不透明。
18 | */
19 | public interface IClimateCrop {
20 |
21 | // 対応する種や苗
22 | ItemStack getSeedItem(IBlockState thisState);
23 |
24 | // 収穫物
25 | List getCropItems(IBlockState thisState, int fortune);
26 |
27 | // 成長に使用。育つ環境かどうか
28 | boolean isSuitableClimate(IClimate climate, IBlockState thisState);
29 |
30 | // 植え付けに使用。土壌のチェック
31 | boolean isSuitablePlace(World world, BlockPos pos, IBlockState underState);
32 |
33 | // bonemealや収穫判定はenumでまとめた
34 | GrowingStage getCurrentStage(IBlockState thisState);
35 |
36 | // 成長後のステート
37 | IBlockState getGrownState();
38 |
39 | // 基底のステート
40 | IBlockState setGroundState(IBlockState state);
41 |
42 | // 成長させる
43 | boolean grow(World world, BlockPos pos, IBlockState thisState);
44 |
45 | // 収穫
46 | boolean harvest(World world, BlockPos pos, IBlockState thisState, EntityPlayer player);
47 |
48 | // IClimateをチェックする範囲。{heat, hum, air}になるよう返すこと。
49 | int[] checkingRange();
50 |
51 | List getSuitableTemp(IBlockState thisState);
52 |
53 | List getSuitableHum(IBlockState thisState);
54 |
55 | List getSuitableAir(IBlockState thisState);
56 |
57 | }
58 |
--------------------------------------------------------------------------------
/main/java/defeatedcrow/hac/api/energy/capability/TorqueCapabilityHandler.java:
--------------------------------------------------------------------------------
1 | package defeatedcrow.hac.api.energy.capability;
2 |
3 | import java.util.concurrent.Callable;
4 |
5 | import net.minecraft.nbt.NBTBase;
6 | import net.minecraft.nbt.NBTTagCompound;
7 | import net.minecraft.util.EnumFacing;
8 | import net.minecraftforge.common.capabilities.Capability;
9 | import net.minecraftforge.common.capabilities.CapabilityInject;
10 | import net.minecraftforge.common.capabilities.CapabilityManager;
11 |
12 | public class TorqueCapabilityHandler {
13 |
14 | private TorqueCapabilityHandler() {}
15 |
16 | public static final TorqueCapabilityHandler INSTANCE = new TorqueCapabilityHandler();
17 |
18 | @CapabilityInject(ITorqueHandler.class)
19 | public static Capability TORQUE_HANDLER_CAPABILITY = null;
20 |
21 | public static void register() {
22 | CapabilityManager.INSTANCE.register(ITorqueHandler.class, INSTANCE.new StorageDC(), INSTANCE.new CallableDC());
23 | }
24 |
25 | public class StorageDC implements Capability.IStorage {
26 |
27 | @Override
28 | public NBTBase writeNBT(Capability capability, ITorqueHandler instance, EnumFacing side) {
29 | NBTTagCompound nbt = new NBTTagCompound();
30 | instance.writeToNBTTag(nbt);
31 | return nbt;
32 | }
33 |
34 | @Override
35 | public void readNBT(Capability capability, ITorqueHandler instance, EnumFacing side,
36 | NBTBase nbt) {
37 | NBTTagCompound tag = (NBTTagCompound) nbt;
38 | instance.readFromTag(tag);
39 | }
40 |
41 | }
42 |
43 | public class CallableDC implements Callable {
44 |
45 | @Override
46 | public ITorqueHandler call() throws Exception {
47 | return new TorqueTank();
48 | }
49 |
50 | }
51 |
52 | }
53 |
--------------------------------------------------------------------------------
/main/java/defeatedcrow/hac/api/energy/ITorqueDC.java:
--------------------------------------------------------------------------------
1 | package defeatedcrow.hac.api.energy;
2 |
3 | import net.minecraft.util.EnumFacing;
4 |
5 | /**
6 | * トルクを扱うTileEntityに実装するもの
7 | */
8 | public abstract interface ITorqueDC {
9 |
10 | /* 向きの制御 */
11 |
12 | // Tileの基底部分の向き。設置後に変更できない。
13 | EnumFacing getBaseSide();
14 |
15 | // Tileの上部の向き。設置後に回せる。
16 | EnumFacing getFaceSide();
17 |
18 | // 動力を受け入れられるか
19 | boolean isInputSide(EnumFacing side);
20 |
21 | // 動力を出力できるか
22 | boolean isOutputSide(EnumFacing side);
23 |
24 | // 設置時の向き設定
25 | void setBaseSide(EnumFacing side);
26 |
27 | // 上部の向きを持つかどうか
28 | boolean hasFaceSide();
29 |
30 | // 上部の向き設定
31 | void setFaceSide(EnumFacing side);
32 |
33 | // 上部だけを回したいときに
34 | void rotateFace();
35 |
36 | /* 速度の管理 */
37 |
38 | // 有効な角加速度。実際に速度に影響する。
39 | float getEffectiveAcceleration();
40 |
41 | // 与えられている角加速度
42 | float getCurrentAcceleration();
43 |
44 | // 摩擦力
45 | float getFrictionalForce();
46 |
47 | // ギアサイズ。トルクに影響する。
48 | float getGearTier();
49 |
50 | // トルク
51 | float getCurrentTorque();
52 |
53 | // 回転速度
54 | float getRotationalSpeed();
55 |
56 | /*
57 | * エネルギーは、"トルク"の形でやりとりされる。
58 | * よって、ブロック間で送受信されるデータはトルクの大きさと向きのみであり、スピードは基本的に装置内のみで利用される。
59 | * 次の装置にエネルギーを伝える場合はEffectiveAccelをTorqueに変換して伝える。
60 | * よって、次の装置に伝わる際には遅延が生じる。
61 | */
62 |
63 | /*
64 | * トルクは受け取り用のfloatに一時的にプールされるが、Tick処理時にすべて消費されて0になる。
65 | * トルクをタンクのように溜めたり、長時間保持することは出来ない。
66 | */
67 |
68 | /*
69 | * 前の装置のトルク -> GearTier * Accel
70 | * EffectiveAccel <- Accel - prevAccel
71 | * 次の装置へのトルク <- prevAccel * GearTier (負の場合は0になる)
72 | * トルクは装置がレシピなどに消費した場合、その分だけ減少して次の装置に伝わる。
73 | * ただしほとんどの仕事装置はインプットのみで次の装置には発展しないが…
74 | */
75 |
76 | /*
77 | * 回転速度は角加速度によって増減する。
78 | * Speed <- (prevSpeed * Frict) + Accel
79 | */
80 |
81 | }
82 |
--------------------------------------------------------------------------------
/main/java/defeatedcrow/hac/api/damage/ClimateDamageEvent.java:
--------------------------------------------------------------------------------
1 | package defeatedcrow.hac.api.damage;
2 |
3 | import defeatedcrow.hac.api.climate.IClimate;
4 | import net.minecraft.entity.EntityLivingBase;
5 | import net.minecraft.util.DamageSource;
6 | import net.minecraftforge.common.MinecraftForge;
7 | import net.minecraftforge.event.entity.living.LivingEvent;
8 | import net.minecraftforge.fml.common.eventhandler.Cancelable;
9 |
10 | /**
11 | * ClimateDamage発生直前に発火するEvent
12 | * キャンセルした場合はDamage処理自体がなくなる。
13 | * 2.0F未満では瀕死時にダメージが止まる。また、1.0Fを下回ると自動的にキャンセルされる。
14 | */
15 | @Cancelable
16 | public class ClimateDamageEvent extends LivingEvent {
17 |
18 | private DamageSource source;
19 | private float amount;
20 | private final IClimate climate;
21 |
22 | public ClimateDamageEvent(EntityLivingBase livingIn, DamageSource sourceIn, IClimate climateIn, float amountIn) {
23 | super(livingIn);
24 | source = sourceIn;
25 | amount = amountIn;
26 | climate = climateIn;
27 | }
28 |
29 | public DamageSet result() {
30 | MinecraftForge.EVENT_BUS.post(this);
31 | if (isCanceled()) {
32 | return new DamageSet(0, source);
33 | }
34 |
35 | return new DamageSet(amount, source);
36 | }
37 |
38 | public DamageSource getSource() {
39 | return source;
40 | }
41 |
42 | public float getAmount() {
43 | return amount;
44 | }
45 |
46 | public IClimate getClimate() {
47 | return climate;
48 | }
49 |
50 | public void setAmount(float amountIn) {
51 | this.amount = amountIn;
52 | }
53 |
54 | public void setDamageSource(DamageSource sourceIn) {
55 | source = sourceIn;
56 | }
57 |
58 | public final class DamageSet {
59 |
60 | public final float damage;
61 | public final DamageSource source;
62 |
63 | public DamageSet(float d, DamageSource s) {
64 | damage = d;
65 | source = s;
66 | }
67 |
68 | }
69 | }
70 |
--------------------------------------------------------------------------------
/main/java/defeatedcrow/hac/core/packet/command/MHandlerComConfig.java:
--------------------------------------------------------------------------------
1 | package defeatedcrow.hac.core.packet.command;
2 |
3 | import java.io.File;
4 |
5 | import defeatedcrow.hac.config.ClimateConfig;
6 | import defeatedcrow.hac.config.CoreConfigDC;
7 | import defeatedcrow.hac.core.ClimateCore;
8 | import defeatedcrow.hac.core.climate.ArmorResistantRegister;
9 | import defeatedcrow.hac.core.climate.HeatBlockRegister;
10 | import defeatedcrow.hac.core.climate.MobResistantRegister;
11 | import defeatedcrow.hac.core.fluid.FluidDictionaryDC;
12 | import defeatedcrow.hac.core.plugin.main.MainComHelper;
13 | import net.minecraftforge.common.config.Configuration;
14 | import net.minecraftforge.fml.common.network.simpleimpl.IMessage;
15 | import net.minecraftforge.fml.common.network.simpleimpl.IMessageHandler;
16 | import net.minecraftforge.fml.common.network.simpleimpl.MessageContext;
17 | import net.minecraftforge.fml.relauncher.Side;
18 |
19 | public class MHandlerComConfig implements IMessageHandler {
20 |
21 | @Override
22 | // IMessageHandlerのメソッド
23 | public IMessage onMessage(MessageComConfig message, MessageContext ctx) {
24 | if (ctx != null && ctx.side == Side.CLIENT) {
25 | int data = message.data;
26 | if (data == 0) {
27 | File dir = new File(ClimateConfig.configDir, "core.cfg");
28 | CoreConfigDC.INSTANCE.load(new Configuration(dir));
29 | CoreConfigDC.leadBlockNames();
30 | } else if (data == 1) {
31 | ArmorResistantRegister.pre();
32 | } else if (data == 2) {
33 | HeatBlockRegister.pre();
34 | } else if (data == 3) {
35 | MobResistantRegister.pre();
36 | } else if (data == 4 && ClimateCore.loadedMain) {
37 | MainComHelper.reloadMainConfig();
38 | } else if (data == 5 && ClimateCore.isDebug) {
39 | FluidDictionaryDC.post();
40 | }
41 | }
42 | return null;
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/main/java/defeatedcrow/hac/core/plugin/baubles/DCPluginBaubles.java:
--------------------------------------------------------------------------------
1 | package defeatedcrow.hac.core.plugin.baubles;
2 |
3 | import baubles.api.BaublesApi;
4 | import defeatedcrow.hac.api.magic.CharmType;
5 | import defeatedcrow.hac.api.magic.IJewelCharm;
6 | import defeatedcrow.hac.core.util.DCUtil;
7 | import net.minecraft.entity.player.EntityPlayer;
8 | import net.minecraft.item.ItemStack;
9 | import net.minecraft.util.NonNullList;
10 |
11 | public class DCPluginBaubles {
12 |
13 | public static NonNullList getBaublesCharm(EntityPlayer player, CharmType type) {
14 | NonNullList ret = NonNullList.create();
15 | for (int i = 0; i < 7; i++) {
16 | ItemStack item = BaublesApi.getBaublesHandler(player).getStackInSlot(i);
17 | if (!DCUtil.isEmpty(item) && item.getItem() instanceof IJewelCharm) {
18 | IJewelCharm charm = (IJewelCharm) item.getItem();
19 | if (type == null || charm.getCharmType(item.getItemDamage()) == type) {
20 | ret.add(item);
21 | }
22 | }
23 | }
24 |
25 | return ret;
26 | }
27 |
28 | public static boolean hasBaublesCharm(EntityPlayer player, ItemStack item) {
29 | if (item.getItem() instanceof CharmItemBase) {
30 | int[] num = ((CharmItemBase) item.getItem()).getBaubleType(item).getValidSlots();
31 | if (num != null) {
32 | for (int i : num) {
33 | ItemStack item2 = BaublesApi.getBaublesHandler(player).getStackInSlot(i);
34 | if (!DCUtil.isEmpty(item2) && !DCUtil.isEmpty(item)) {
35 | return item2.getItem() == item.getItem() && item2.getItemDamage() == item.getItemDamage();
36 | }
37 | }
38 | }
39 | }
40 |
41 | return false;
42 | }
43 |
44 | public static void setBaublesCharmEmpty(EntityPlayer player, int slot) {
45 | BaublesApi.getBaublesHandler(player).setStackInSlot(slot, ItemStack.EMPTY);
46 | player.inventory.markDirty();
47 | }
48 |
49 | }
50 |
--------------------------------------------------------------------------------
/main/java/defeatedcrow/hac/api/recipe/ICrusherRecipeRegister.java:
--------------------------------------------------------------------------------
1 | package defeatedcrow.hac.api.recipe;
2 |
3 | import java.util.List;
4 |
5 | import net.minecraft.item.ItemStack;
6 | import net.minecraftforge.fluids.FluidStack;
7 |
8 | public interface ICrusherRecipeRegister {
9 |
10 | /**
11 | * Recipeのリストを得る。
12 | */
13 | List getRecipeList();
14 |
15 | /**
16 | * Recipe登録
17 | *
18 | * @param output
19 | * : 完成品
20 | * @param secondary
21 | * : 副生物 null可
22 | * @param tertialyChance
23 | * : 副生成物の生成率 0.0F-1.0F
24 | * @param secondary
25 | * : 副生物2 null可
26 | * @param tertialyChance
27 | * : 副生成物2の生成率 0.0F-1.0F
28 | * @param outputFluid
29 | * : 生成液体
30 | * @param catalyst
31 | * : 触媒アイテム 消費しない
32 | * @param input
33 | * : 材料
34 | */
35 | void addRecipe(ItemStack output, ItemStack secondary, float secondaryChance, ItemStack tertialy,
36 | float tertialyChance, FluidStack outputFluid, ItemStack catalyst, Object input);
37 |
38 | void addRecipe(ItemStack output, ItemStack secondary, float secondaryChance, ItemStack tertialy,
39 | float tertialyChance, ItemStack catalyst, Object input);
40 |
41 | void addRecipe(ItemStack output, ItemStack secondary, float secondaryChance, FluidStack outputFluid,
42 | ItemStack catalyst, Object input);
43 |
44 | void addRecipe(ItemStack output, ItemStack secondary, float secondaryChance, ItemStack catalyst, Object input);
45 |
46 | void addRecipe(ItemStack output, ItemStack catalyst, Object input);
47 |
48 | void addRecipe(ICrusherRecipe recipe);
49 |
50 | /**
51 | * inputs, Climateでレシピを判定
52 | */
53 | ICrusherRecipe getRecipe(ItemStack input, ItemStack catalyst);
54 |
55 | @Deprecated
56 | ICrusherRecipe getRecipe(ItemStack input);
57 |
58 | boolean removeRecipe(ItemStack input, ItemStack catalyst);
59 |
60 | }
61 |
--------------------------------------------------------------------------------