Skip to content

Commit

Permalink
Update the 1.11.2 branch to the latest code from the 1.10.2 branch.
Browse files Browse the repository at this point in the history
  • Loading branch information
alexbegt committed May 4, 2017
1 parent 376ee48 commit c014e50
Show file tree
Hide file tree
Showing 38 changed files with 833 additions and 385 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Expand Up @@ -70,7 +70,7 @@ dependencies {

deobfCompile "mezz.jei:jei_${minecraft_version}:${jei_version}"

deobfCompile "MCMultiPart2:MCMultiPart-exp:${mcmultipart_version}:universal"
deobfCompile "MCMultiPart2:MCMultiPart-exp:${mcmultipart_version}"
}

// sets version to the slimeKnights version format
Expand Down
10 changes: 5 additions & 5 deletions gradle.properties
Expand Up @@ -2,14 +2,14 @@ mod_version=4.2.0

minecraft_version=1.11.2

forge_version=13.20.0.2282
mappings_version=snapshot_20170415
forge_version=13.20.0.2294
mappings_version=snapshot_20170503

mantle_version=1.2.0.+
tconstruct_version=2.6.2.+
tconstruct_version=2.7.0.+

jei_version=4.3.2.+
jei_version=4.3.4.+

hwyla_version=1.8.13-B26

mcmultipart_version=2.0.0_9
mcmultipart_version=2.0.0_+
2 changes: 1 addition & 1 deletion src/main/java/com/progwml6/natura/common/ClientProxy.java
Expand Up @@ -10,7 +10,7 @@ public class ClientProxy extends CommonProxy
{
protected void registerItemModelNatura(ItemStack item, String name)
{
if (item != ItemStack.EMPTY && !StringUtils.isNullOrEmpty(name))
if (!item.isEmpty() && !StringUtils.isNullOrEmpty(name))
{
ModelRegisterUtil.registerItemModel(item, Util.getResource(name));
}
Expand Down
Expand Up @@ -7,7 +7,6 @@
import net.minecraft.block.Block;
import net.minecraft.client.renderer.ItemMeshDefinition;
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
Expand All @@ -28,7 +27,7 @@ public final class ModelRegisterUtil
/** Registers the item-meta combo in the itemstack with the given location for the inventory-variant */
public static void registerItemModel(ItemStack itemStack, ResourceLocation name)
{
if (itemStack != ItemStack.EMPTY && name != null)
if (!itemStack.isEmpty() && name != null)
{
// tell the loader to load the model
ModelLoader.registerItemVariants(itemStack.getItem(), name);
Expand All @@ -42,7 +41,7 @@ public static ResourceLocation registerItemModel(Item item)
{
ResourceLocation itemLocation = null;

if (item != Items.AIR)
if (item != null)
{
itemLocation = item.getRegistryName();
}
Expand Down Expand Up @@ -88,7 +87,7 @@ public static void registerItemModel(Item item, int meta)
/** Registers the given item with the given meta and its registry name for the given variant */
public static void registerItemModel(Item item, int meta, String variant)
{
if (item != Items.AIR)
if (item != null)
{
registerItemModel(item, meta, item.getRegistryName(), variant);
}
Expand All @@ -97,7 +96,7 @@ public static void registerItemModel(Item item, int meta, String variant)
/** Registers the given item/meta combination with the model at the given location, and the given variant */
public static void registerItemModel(Item item, int meta, ResourceLocation location, String variant)
{
if (item != Items.AIR && !StringUtils.isNullOrEmpty(variant))
if (item != null && !StringUtils.isNullOrEmpty(variant))
{
//ModelLoader.registerItemVariants(item, location);
ModelLoader.setCustomModelResourceLocation(item, meta, new ModelResourceLocation(item.getRegistryName(), variant));
Expand Down
10 changes: 9 additions & 1 deletion src/main/java/com/progwml6/natura/common/config/Config.java
Expand Up @@ -187,6 +187,7 @@ public static boolean syncConfig()
// Cloud Start
cloudBlacklist = configFile.get(WORLDGEN, "dimension blacklist(clouds)", cloudBlacklist).getIntList();
darkCloudBlacklist = configFile.get(WORLDGEN, "dimension blacklist(dark clouds)", darkCloudBlacklist).getIntList();
ashBlacklist = configFile.get(WORLDGEN, "dimension blacklist(ash clouds)", ashBlacklist).getIntList();
sulfurCloudBlacklist = configFile.get(WORLDGEN, "dimension blacklist(sulfur clouds)", sulfurCloudBlacklist).getIntList();

cloudSpawnRarity = configFile.get(WORLDGEN, "Cloud Spawn Rarity", cloudSpawnRarity).getInt(cloudSpawnRarity);
Expand All @@ -207,6 +208,9 @@ public static boolean syncConfig()

enableHeatscarSpider = configFile.get(ENTITIES, "Enable Heatscar Spiders", enableHeatscarSpider).getBoolean(enableHeatscarSpider);

overworldWorldGenBlacklist = configFile.get(WORLDGEN, "Overworld World Generation Dimension Blacklist", overworldWorldGenBlacklist).getIntList();
netherWorldGenBlacklist = configFile.get(WORLDGEN, "Nether World Generation Dimension Blacklist", netherWorldGenBlacklist).getIntList();

// save changes if any
boolean changed = false;
if (configFile.hasChanged())
Expand All @@ -224,8 +228,9 @@ public static boolean syncConfig()
public static boolean generateAshClouds = true;
public static boolean generateDarkClouds = true;

public static int[] darkCloudBlacklist = new int[] {};
public static int[] cloudBlacklist = new int[] {};
public static int[] darkCloudBlacklist = new int[] {};
public static int[] ashBlacklist = new int[] {};
public static int[] sulfurCloudBlacklist = new int[] {};

public static boolean enableCloudBlocks = false;
Expand Down Expand Up @@ -353,6 +358,9 @@ public static boolean syncConfig()
public static boolean dropBarley = true;
public static boolean dropCotton = true;

public static int[] overworldWorldGenBlacklist = new int[] {};
public static int[] netherWorldGenBlacklist = new int[] {};

static Configuration configFile;
//@formatter:on
}
@@ -1,7 +1,5 @@
package com.progwml6.natura.common.gui.common;

import javax.annotation.Nullable;

import com.progwml6.natura.nether.block.furnace.tile.TileEntityNetherrackFurnace;

import net.minecraft.entity.player.EntityPlayer;
Expand Down Expand Up @@ -113,10 +111,14 @@ public boolean canInteractWith(EntityPlayer playerIn)
}

/**
* Take a stack from the specified inventory slot.
* Handle when the stack in slot {@code index} is shift-clicked. Normally this moves the stack between the player
* inventory and the other inventory(s).
*
* @param playerIn Player that interacted with this {@code Container}.
* @param index Index of the {@link Slot}. This index is relative to the list of slots in this {@code Container},
* {@link #inventorySlots}.
*/
@Override
@Nullable
public ItemStack transferStackInSlot(EntityPlayer playerIn, int index)
{
ItemStack itemstack = ItemStack.EMPTY;
Expand All @@ -138,7 +140,7 @@ public ItemStack transferStackInSlot(EntityPlayer playerIn, int index)
}
else if (index != 1 && index != 0)
{
if (FurnaceRecipes.instance().getSmeltingResult(itemstack1).isEmpty())
if (!FurnaceRecipes.instance().getSmeltingResult(itemstack1).isEmpty())
{
if (!this.mergeItemStack(itemstack1, 0, 1, false))
{
Expand Down
Expand Up @@ -40,15 +40,15 @@ public ItemStack addMeta(int meta, String name)
}

@Override
public EnumActionResult onItemUse(EntityPlayer playerIn, World worldIn, BlockPos pos, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ)
public EnumActionResult onItemUse(EntityPlayer player, World worldIn, BlockPos pos, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ)
{
if (facing != EnumFacing.UP)
{
return EnumActionResult.FAIL;
}
else
{
ItemStack itemstack = playerIn.getHeldItem(hand);
ItemStack itemstack = player.getHeldItem(hand);

int meta = itemstack.getMetadata();

Expand All @@ -62,15 +62,15 @@ public EnumActionResult onItemUse(EntityPlayer playerIn, World worldIn, BlockPos
pos = pos.offset(facing);
}

if (playerIn.canPlayerEdit(pos, facing, itemstack) && this.states.get(meta).getBlock().canPlaceBlockAt(worldIn, pos))
if (player.canPlayerEdit(pos, facing, itemstack) && this.states.get(meta).getBlock().canPlaceBlockAt(worldIn, pos))
{
EnumFacing enumfacing = EnumFacing.fromAngle(playerIn.rotationYaw);
EnumFacing enumfacing = EnumFacing.fromAngle(player.rotationYaw);
int i = enumfacing.getFrontOffsetX();
int j = enumfacing.getFrontOffsetZ();
boolean flag = i < 0 && hitZ < 0.5F || i > 0 && hitZ > 0.5F || j < 0 && hitX > 0.5F || j > 0 && hitX < 0.5F;
placeDoor(worldIn, pos, enumfacing, this.states.get(meta), flag);
SoundType soundtype = worldIn.getBlockState(pos).getBlock().getSoundType(worldIn.getBlockState(pos), worldIn, pos, playerIn);
worldIn.playSound(playerIn, pos, soundtype.getPlaceSound(), SoundCategory.BLOCKS, (soundtype.getVolume() + 1.0F) / 2.0F, soundtype.getPitch() * 0.8F);
SoundType soundtype = worldIn.getBlockState(pos).getBlock().getSoundType(worldIn.getBlockState(pos), worldIn, pos, player);
worldIn.playSound(player, pos, soundtype.getPlaceSound(), SoundCategory.BLOCKS, (soundtype.getVolume() + 1.0F) / 2.0F, soundtype.getPitch() * 0.8F);
itemstack.shrink(1);
return EnumActionResult.SUCCESS;
}
Expand Down
Expand Up @@ -149,7 +149,7 @@ public void randomDisplayTick(IBlockState stateIn, World worldIn, BlockPos pos,
}

@Override
public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumHand hand, EnumFacing side, float hitX, float hitY, float hitZ)
public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ)
{
if (worldIn.isRemote)
{
Expand Down
Expand Up @@ -16,6 +16,7 @@
import net.minecraft.block.state.BlockStateContainer;
import net.minecraft.block.state.IBlockState;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
Expand All @@ -24,6 +25,7 @@
import net.minecraft.util.IStringSerializable;
import net.minecraft.util.NonNullList;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.RayTraceResult;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side;
Expand Down Expand Up @@ -92,14 +94,29 @@ protected int getSaplingDropChance(IBlockState state)
@Override
public Item getItemDropped(IBlockState state, Random rand, int fortune)
{
return Item.getItemFromBlock(NaturaNether.netherSapling);
if (state.getValue(TYPE) == LeavesType.BLOODWOOD)
{
return Item.getItemFromBlock(NaturaNether.netherSapling2);
}
else
{
return Item.getItemFromBlock(NaturaNether.netherSapling);
}
}

// sapling meta
@Override
public int damageDropped(IBlockState state)
{
return (state.getValue(TYPE)).ordinal() & 3; // only first 2 bits
return state.getValue(TYPE).getSaplingMeta();
}

@Nonnull
@Override
public ItemStack getPickBlock(@Nonnull IBlockState state, RayTraceResult target, @Nonnull World world, @Nonnull BlockPos pos, EntityPlayer player)
{
int meta = state.getValue(TYPE).getWailaLeavesMeta();
return new ItemStack(Item.getItemFromBlock(this), 1, meta);
}

// item dropped on silktouching
Expand All @@ -121,15 +138,15 @@ protected BlockStateContainer createBlockState()
public IBlockState getStateFromMeta(int meta)
{
int type = meta % 4;

if (type < 0 || type >= LeavesType.values().length)
{
type = 0;
}

LeavesType logtype = LeavesType.values()[type];
return this.getDefaultState()
.withProperty(TYPE, logtype)
.withProperty(DECAYABLE, (meta & 4) == 0)
.withProperty(CHECK_DECAY, (meta & 8) > 0);

return this.getDefaultState().withProperty(TYPE, logtype).withProperty(DECAYABLE, (meta & 4) == 0).withProperty(CHECK_DECAY, (meta & 8) > 0);
}

@Override
Expand Down Expand Up @@ -161,6 +178,7 @@ public BlockPlanks.EnumType getWoodType(int meta)
public List<ItemStack> onSheared(ItemStack item, IBlockAccess world, BlockPos pos, int fortune)
{
IBlockState state = world.getBlockState(pos);

return Lists.newArrayList(this.getSilkTouchDrop(state));
}

Expand All @@ -172,13 +190,19 @@ public boolean isLeaves(IBlockState state, IBlockAccess world, BlockPos pos)

public enum LeavesType implements IStringSerializable, EnumBlock.IEnumMeta
{
GHOSTWOOD, BLOODWOOD, FUSEWOOD;
GHOSTWOOD(0, 0), BLOODWOOD(0, 1), FUSEWOOD(1, 2);

public final int meta;

LeavesType()
public final int saplingMeta;

public final int wailaLeavesMeta;

LeavesType(int saplingMeta, int wailaLeavesMeta)
{
this.meta = this.ordinal();
this.saplingMeta = saplingMeta;
this.wailaLeavesMeta = wailaLeavesMeta;
}

@Override
Expand All @@ -192,6 +216,16 @@ public int getMeta()
{
return this.meta;
}

public int getSaplingMeta()
{
return this.saplingMeta;
}

public int getWailaLeavesMeta()
{
return this.wailaLeavesMeta;
}
}

}
Expand Up @@ -101,7 +101,7 @@ public Item getItemDropped(IBlockState state, Random rand, int fortune)
@Override
public int damageDropped(IBlockState state)
{
return 3;
return 2;
}

@Override
Expand Down
Expand Up @@ -65,7 +65,7 @@ public BlockPos getBedSpawnPosition(IBlockState state, IBlockAccess world, Block
}

@Override
public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumHand hand, EnumFacing side, float hitX, float hitY, float hitZ)
public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ)
{
Random rand = new Random();
rand.setSeed(2 ^ 16 + 2 ^ 8 + (4 * 3 * 271));
Expand Down
Expand Up @@ -35,6 +35,8 @@ public class BlockNetherGlowshroom extends BlockMushroom
public BlockNetherGlowshroom()
{
super();

this.setLightLevel(0.625f);
this.setCreativeTab(NaturaRegistry.tabWorld);
this.setSoundType(SoundType.PLANT);
}
Expand Down Expand Up @@ -74,6 +76,7 @@ public void updateTick(World worldIn, BlockPos pos, IBlockState state, Random ra
}

currentState = worldIn.getBlockState(pos);

if (worldIn.isAirBlock(blockpos1) && this.canBlockStay(worldIn, blockpos1, currentState))
{
worldIn.setBlockState(blockpos1, currentState, 3);
Expand All @@ -96,6 +99,7 @@ public boolean canBlockStay(World worldIn, BlockPos pos, IBlockState state)
if (pos.getY() >= 0 && pos.getY() < 256)
{
IBlockState iblockstate = worldIn.getBlockState(pos.down());

return (iblockstate.getBlock() == Blocks.MYCELIUM || iblockstate.getBlock() == Blocks.NETHERRACK || iblockstate.getBlock() == Blocks.SOUL_SAND || iblockstate.getBlock() == NaturaNether.netherTaintedSoil) ? true : (worldIn.getLight(pos) < 13 && iblockstate.getBlock().canSustainPlant(iblockstate, worldIn, pos.down(), net.minecraft.util.EnumFacing.UP, this));
}
else
Expand Down
Expand Up @@ -41,6 +41,9 @@ public class BlockNetherLargeGlowshroom extends Block
public BlockNetherLargeGlowshroom(Block smallStateIn, int glowshroomMetaIn)
{
super(Material.WOOD);

this.setLightLevel(0.625f);

this.smallState = smallStateIn;
this.glowshroomMeta = glowshroomMetaIn;
}
Expand Down Expand Up @@ -126,6 +129,7 @@ public boolean isOpaqueCube(IBlockState state)
public boolean shouldSideBeRendered(IBlockState blockState, IBlockAccess blockAccess, BlockPos pos, EnumFacing side)
{
Block block = blockAccess.getBlockState(pos.offset(side)).getBlock();

if (block == NaturaNether.netherLargeBlueGlowshroom || block == NaturaNether.netherLargePurpleGlowshroom)
{
return false;
Expand Down Expand Up @@ -156,6 +160,7 @@ public void onEntityCollidedWithBlock(World worldIn, BlockPos pos, IBlockState s
{
entityIn.motionY *= 0.25F;
}

entityIn.fallDistance -= 0.25f;

if (entityIn.motionY == 0f)
Expand All @@ -167,6 +172,7 @@ public void onEntityCollidedWithBlock(World worldIn, BlockPos pos, IBlockState s
if (entityIn instanceof EntityLiving)
{
EntityLiving living = (EntityLiving) entityIn;

living.addPotionEffect(new PotionEffect(MobEffects.NAUSEA, 100, 0));
}
}
Expand Down

0 comments on commit c014e50

Please sign in to comment.