Jump to content

krikke93

Members
  • Posts

    19
  • Joined

  • Last visited

Everything posted by krikke93

  1. Thank you very much for your help. It indeed only affects melee damage by Mobs.
  2. I suggest you take a look at tutorials on Ore Generation. It's quite simple to understand and you can use that knowledge to generate practically anything. At least that's how I did it.
  3. Thank you! I totally forgot to register the ItemBlock (facepalm)
  4. -Normally it should, not 100% sure though -No, I checked the damage I take by spawning a skeleton in survival mode. (they should be able to kill me in 1-2 shots with a multiplier of x10) I will try printing out the damage when I get back home though, that will let me know if the method is being called and how many damage the entity is doing. Thanks for your help so far, really appreciated
  5. Hi, I'm trying to create a block that acts just like a lilypad, but I stumbled upon a little problem. So here's my block class: public class ExtraOysterBlock extends BlockLilyPad { public ExtraOysterBlock() { setUnlocalizedName("oyster"); setCreativeTab(ExpansionMod.tabMisc); } @Override public net.minecraftforge.common.EnumPlantType getPlantType(net.minecraft.world.IBlockAccess world, BlockPos pos) { return net.minecraftforge.common.EnumPlantType.Water; } } The problem is, I can't right click water with the oyster to place it on top of the water. Instead, the game thinks I'm clicking the block I'm looking at behind the water and ignores water completely. The only way for me to currently place my oyster is by clicking a block next to water like so: Anyone have any idea how I make the game notice I'm clicking water instead of the blocks behind it? Thanks in advance, ~Krikke
  6. I seem to be missing something, because this doesn't seem to work either: @SubscribeEvent public void addMobDamage(EntityJoinWorldEvent e) { if(e.entity instanceof EntityMob) { EntityMob mob = (EntityMob)e.entity; AttributeModifier modifier = new AttributeModifier(UUID.fromString("82611fdd-7e53-4b74-86c0-8413b1def591"), "allMobDamagex10", 10.0, 1); if(mob.getEntityAttribute(SharedMonsterAttributes.attackDamage).getModifier(UUID.fromString("82611fdd-7e53-4b74-86c0-8413b1def591")) == null) { mob.getEntityAttribute(SharedMonsterAttributes.attackDamage).applyModifier(modifier); } } } -I used EntityJoinWorldEvent -I used an attribute modifier -I've tried changing the operation to 0, 1 and 2. Neither of them change anything. -The second if-statement is there to make sure the game doesn't crash when re-entering a world. It would give an error the entity already has this modifier. Again, what am I doing wrong? I'm sorry I can't seem to get this right Thanks in advance, ~Krikke
  7. What am I doing wrong here? As far as I understood, this should multiply the attack damage of all mobs by 10, right? @SubscribeEvent public void addMobDamage(LivingAttackEvent e) { if(e.entityLiving instanceof EntityMob) { EntityMob mob = (EntityMob)e.entityLiving; mob.getEntityAttribute(SharedMonsterAttributes.attackDamage).setBaseValue(mob.getEntityAttribute(SharedMonsterAttributes.attackDamage).getBaseValue()*10.0); } }
  8. Could you give a more detailed expanation and/or example for me to start with as I have no clue how Events and Modifiers work. I'm very new to modding, so my appologies if this is some basic stuff. Thanks in advance, ~Krikke
  9. Hello, I'm trying to override the current vanilla mobs with slight adjustments (like them dealing more damage for example). For example, I created a class called AdjustedSkeleton which just extends EntitySkeleton and adjusts the damage it deals when attacking. To register this mob, I had to first remove the standard skeleton to be able to override it. Here's what I did: private static Map stringToClassMapping = EntityList.stringToClassMapping; private static Map classToStringMapping = EntityList.classToStringMapping; private static Map idToClassMapping = EntityList.idToClassMapping; public static void init() { removeEntity(EntitySkeleton.class, "Skeleton", 51); } private static void removeEntity(Class entity, String name, int id) { stringToClassMapping.remove(name); classToStringMapping.remove(entity); idToClassMapping.remove(id); } However, there are still two Maps from which the skeleton needs to be removed in order for the new skeleton to be able to be registered on the exact same name as the vanilla "Skeleton". These two Maps are located in the EntityList class and are private: private static final Map classToIDMapping = Maps.newHashMap(); private static final Map stringToIDMapping = Maps.newHashMap(); As you can see, I was able to simply remove the Skeleton from the other three maps, but for some reason, these two are private and I cannot edit them from my mod classes. I also don't want to modify the .class files. What do you suggest I do at this point? Maybe you have a better approach to this? ~Cheers, Krikke
  10. Thanks, that solved my Stairs issue. Now I just need to find a way to make slabs stack to become a double_slab.
  11. Alright, thank you very much for your help. I was wondering how you'd change vanilla code for a while now
  12. Although I indeed forgot to Override isFullCube() in both classes, it didn't solve my problems Thanks for the suggestion though, I'm hoping someone sees what I'm doing wrong. - Krikke
  13. Hi, this was a very interesting read. However, I still have no idea how to change this [0,0] entry. Where do I find it? How do I edit it or make sure it overrides the original minecraft entry? (I'm very new to modding but learning pretty fast) Cheers, Krikke
  14. Why can"t you run it? You pirated the game? Don't have the right Forge version? If you pirated, just buy it. Totally worth the 20 bucks. If you don't have the right forge version, download the src from their website: http://files.minecraftforge.net/
  15. Hi everyone, I'd like to change the lighting of my mod, so that it would be completely dark during nights and in unlit places. The same effect this Mod brings: http://www.curse.com/mc-mods/minecraft/225957-hardcore-darkness I've taken a look at the source code of this mod, but I can't seem to understand what is going on. I do understand I would need to change the minimum light level for every Block to total darkness. Anyone have an idea how I can start doing this? Any help is appreciated, kind regards, Krikke
  16. Hi everyone, I'm having some problems with getting my custom stair and slab blocks to work properly. I'll start with my stairs, since those are almost complete. The problem I'm having is a lighting issue as you can see in this screenshot: http://puu.sh/j5own/753e2aa570.jpg Stairs Class: public class ExtraStairsBlock extends BlockStairs { public ExtraStairsBlock(IBlockState modelState, String name) { super(modelState); setUnlocalizedName(name); setCreativeTab(ExpansionMod.tabBlocks); } } Stairs modelstate json: { "variants": { "facing=east,half=bottom,shape=straight": { "model": "em:mahogany_stairs" }, "facing=west,half=bottom,shape=straight": { "model": "em:mahogany_stairs", "y": 180, "uvlock": true }, "facing=south,half=bottom,shape=straight": { "model": "em:mahogany_stairs", "y": 90, "uvlock": true }, "facing=north,half=bottom,shape=straight": { "model": "em:mahogany_stairs", "y": 270, "uvlock": true }, "facing=east,half=bottom,shape=outer_right": { "model": "em:mahogany_outer_stairs" }, "facing=west,half=bottom,shape=outer_right": { "model": "em:mahogany_outer_stairs", "y": 180, "uvlock": true }, "facing=south,half=bottom,shape=outer_right": { "model": "em:mahogany_outer_stairs", "y": 90, "uvlock": true }, "facing=north,half=bottom,shape=outer_right": { "model": "em:mahogany_outer_stairs", "y": 270, "uvlock": true }, "facing=east,half=bottom,shape=outer_left": { "model": "em:mahogany_outer_stairs", "y": 270, "uvlock": true }, "facing=west,half=bottom,shape=outer_left": { "model": "em:mahogany_outer_stairs", "y": 90, "uvlock": true }, "facing=south,half=bottom,shape=outer_left": { "model": "em:mahogany_outer_stairs" }, "facing=north,half=bottom,shape=outer_left": { "model": "em:mahogany_outer_stairs", "y": 180, "uvlock": true }, "facing=east,half=bottom,shape=inner_right": { "model": "em:mahogany_inner_stairs" }, "facing=west,half=bottom,shape=inner_right": { "model": "em:mahogany_inner_stairs", "y": 180, "uvlock": true }, "facing=south,half=bottom,shape=inner_right": { "model": "em:mahogany_inner_stairs", "y": 90, "uvlock": true }, "facing=north,half=bottom,shape=inner_right": { "model": "em:mahogany_inner_stairs", "y": 270, "uvlock": true }, "facing=east,half=bottom,shape=inner_left": { "model": "em:mahogany_inner_stairs", "y": 270, "uvlock": true }, "facing=west,half=bottom,shape=inner_left": { "model": "em:mahogany_inner_stairs", "y": 90, "uvlock": true }, "facing=south,half=bottom,shape=inner_left": { "model": "em:mahogany_inner_stairs" }, "facing=north,half=bottom,shape=inner_left": { "model": "em:mahogany_inner_stairs", "y": 180, "uvlock": true }, "facing=east,half=top,shape=straight": { "model": "em:mahogany_stairs", "x": 180, "uvlock": true }, "facing=west,half=top,shape=straight": { "model": "em:mahogany_stairs", "x": 180, "y": 180, "uvlock": true }, "facing=south,half=top,shape=straight": { "model": "em:mahogany_stairs", "x": 180, "y": 90, "uvlock": true }, "facing=north,half=top,shape=straight": { "model": "em:mahogany_stairs", "x": 180, "y": 270, "uvlock": true }, "facing=east,half=top,shape=outer_right": { "model": "em:mahogany_outer_stairs", "x": 180, "uvlock": true }, "facing=west,half=top,shape=outer_right": { "model": "em:mahogany_outer_stairs", "x": 180, "y": 180, "uvlock": true }, "facing=south,half=top,shape=outer_right": { "model": "em:mahogany_outer_stairs", "x": 180, "y": 90, "uvlock": true }, "facing=north,half=top,shape=outer_right": { "model": "em:mahogany_outer_stairs", "x": 180, "y": 270, "uvlock": true }, "facing=east,half=top,shape=outer_left": { "model": "em:mahogany_outer_stairs", "x": 180, "y": 90, "uvlock": true }, "facing=west,half=top,shape=outer_left": { "model": "em:mahogany_outer_stairs", "x": 180, "y": 270, "uvlock": true }, "facing=south,half=top,shape=outer_left": { "model": "em:mahogany_outer_stairs", "x": 180, "y": 180, "uvlock": true }, "facing=north,half=top,shape=outer_left": { "model": "em:mahogany_outer_stairs", "x": 180, "uvlock": true }, "facing=east,half=top,shape=inner_right": { "model": "em:mahogany_inner_stairs", "x": 180, "uvlock": true }, "facing=west,half=top,shape=inner_right": { "model": "em:mahogany_inner_stairs", "x": 180, "y": 180, "uvlock": true }, "facing=south,half=top,shape=inner_right": { "model": "em:mahogany_inner_stairs", "x": 180, "y": 90, "uvlock": true }, "facing=north,half=top,shape=inner_right": { "model": "em:mahogany_inner_stairs", "x": 180, "y": 270, "uvlock": true }, "facing=east,half=top,shape=inner_left": { "model": "em:mahogany_inner_stairs", "x": 180, "y": 90, "uvlock": true }, "facing=west,half=top,shape=inner_left": { "model": "em:mahogany_inner_stairs", "x": 180, "y": 270, "uvlock": true }, "facing=south,half=top,shape=inner_left": { "model": "em:mahogany_inner_stairs", "x": 180, "y": 180, "uvlock": true }, "facing=north,half=top,shape=inner_left": { "model": "em:mahogany_inner_stairs", "x": 180, "uvlock": true } } } ---------- My second problem I'm having is with custom slabs. These seem a lot harder than stairs, or I might be doing something wrong. Everything seems fine with the textures. The only problem I'm having is that I can't seem to get two slabs to stack onto each other to become a double slab. Custom Slab class: public class ExtraSlabBlock extends BlockSlab { private boolean isDouble; public ExtraSlabBlock(String name, boolean isDouble) { super(Material.wood); String newname = ""; if(isDouble) newname += "double_"; setUnlocalizedName(newname+name); if(!isDouble) setCreativeTab(ExpansionMod.tabBlocks); this.isDouble = isDouble; IBlockState iblockstate = this.blockState.getBaseState(); if (!this.isDouble()) { iblockstate = iblockstate.withProperty(HALF, BlockSlab.EnumBlockHalf.BOTTOM); } this.setDefaultState(iblockstate); this.useNeighborBrightness = !this.isDouble(); } @Override protected BlockState createBlockState() { return new BlockState(this, new IProperty[] {HALF}); } @Override public final IBlockState getStateFromMeta(final int meta) { IBlockState blockState = this.getDefaultState(); if (!this.isDouble()) { EnumBlockHalf value = EnumBlockHalf.BOTTOM; if ((meta & != 0) { value = EnumBlockHalf.TOP; } blockState = blockState.withProperty(HALF, value); } return blockState; } @Override public int getMetaFromState(IBlockState state) { if (this.isDouble()) { return 0; } if ((EnumBlockHalf) state.getValue(HALF) == EnumBlockHalf.TOP) { return 8; } else { return 0; } } public String getId() { return isDouble() ? "slab_double" : "slab"; } @Override public boolean isDouble() { return isDouble; } @Override public String getUnlocalizedName(int meta) { return getUnlocalizedName(); } @Override public IProperty getVariantProperty() { return null; } @Override public Object getVariant(ItemStack stack) { return null; } } Slab modelstate json: { "variants": { "half=bottom": { "model": "em:mahogany_half_slab" }, "half=top": { "model": "em:mahogany_upper_slab" } } } Slab registering: ... public static Block mahogany_slab; public static Block double_mahogany_slab; ... mahogany_slab = new ExtraSlabBlock("mahogany_slab", false); double_mahogany_slab = new ExtraSlabBlock("mahogany_slab", true); ... GameRegistry.registerBlock(mahogany_slab, mahogany_slab.getUnlocalizedName().substring(5)); GameRegistry.registerBlock(double_mahogany_slab, double_mahogany_slab.getUnlocalizedName().substring(5)); ... registerRender(mahogany_slab); registerRender(double_mahogany_slab); ...
  17. Hi, and thanks for your reply. I indeed managed to find the errors on the blockstates in my console. I've tried changing my blockstate json into this: { "variants": { "check_decay=true,decayable=true": { "model": "em:mahogany_leaves" } "check_decay=false,decayable=true": { "model": "em:mahogany_leaves" } "check_decay=true,decayable=false": { "model": "em:mahogany_leaves" } "check_decay=false,decayable=false": { "model": "em:mahogany_leaves" } } } but I'm not sure if this is the correct way to do it as I'm getting another error (and thus missing block textures): java.lang.RuntimeException: Encountered an exception when loading model definition of 'em:mahogany_leaves#check_decay=false,decayable=true' from: 'em:blockstates/mahogany_leaves.json' in resourcepack: 'FMLFileResourcePack:Expansion Mod' My apologies if I'm making a rookie mistake here, but how exactly do you add multiple properties to the blockstate json? EDIT: Never mind, I noticed I didn't put commas at the end of my lines in the json file. It's working perfect now. Thanks a bunch!! -Krikke
  18. This might help in understanding how Items and Blocks work in 1.8: Items: Blocks:
  19. Hello everyone, I'm very new (3 days) to modding and I'm trying to make a custom tree. I've got the logs to work fine, I just need the leaves. However, I know very little about Properties and Metadata and find them very complicated to understand. I got the inventory item texture to work, but the in-world block texture won't show up. Here's what I have so far: Custom Leaves Class package com.krikke93.expansion.blocks; import java.util.List; import java.util.Random; import net.minecraft.block.BlockLeaves; import net.minecraft.block.BlockPlanks.EnumType; import net.minecraft.block.properties.IProperty; import net.minecraft.block.state.BlockState; 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.init.Items; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.BlockPos; import net.minecraft.util.EnumWorldBlockLayer; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; import com.krikke93.expansion.ExpansionMod; public class ExtraLeavesBlock extends BlockLeaves { public ExtraLeavesBlock(String name) { this.setDefaultState(this.blockState.getBaseState().withProperty(CHECK_DECAY, Boolean.valueOf(true)).withProperty(DECAYABLE, Boolean.valueOf(true))); setUnlocalizedName(name); setCreativeTab(ExpansionMod.tabBlocks); } public Item getItemDropped(IBlockState state, Random rand, int fortune) { //return Item.getItemFromBlock(TreeOresBlocks.Saplings1); return null; } protected void dropApple(World worldIn, BlockPos pos, IBlockState state, int chance) { if (worldIn.rand.nextInt(chance) == 0) { spawnAsEntity(worldIn, pos, new ItemStack(Items.apple, 1, 0)); } } public IBlockState getStateFromMeta(int meta) { return this.getDefaultState().withProperty(DECAYABLE, Boolean.valueOf((meta & 4) == 0)).withProperty(CHECK_DECAY, Boolean.valueOf((meta & > 0)); } public int getMetaFromState(IBlockState state) { byte b0 = 0; int i = b0; if (!((Boolean) state.getValue(DECAYABLE)).booleanValue()) { i |= 4; } if (((Boolean) state.getValue(CHECK_DECAY)).booleanValue()) { i |= 8; } return i; } protected BlockState createBlockState() { return new BlockState(this, new IProperty[] { CHECK_DECAY, DECAYABLE }); } @Override public List<ItemStack> onSheared(ItemStack item, IBlockAccess world, BlockPos pos, int fortune) { IBlockState state = world.getBlockState(pos); return new java.util.ArrayList(java.util.Arrays.asList(new ItemStack(this, 1, 0))); } @Override public EnumType getWoodType(int meta) { return null; } @Override @SideOnly(Side.CLIENT) public EnumWorldBlockLayer getBlockLayer() { return Blocks.leaves.getBlockLayer(); } } Registering Blocks public static Block mahogany_leaves; ... public void init() { mahogany_leaves = new ExtraLeavesBlock("mahogany_leaves"); } ... public void register() { GameRegistry.registerBlock(mahogany_leaves, mahogany_leaves.getUnlocalizedName().substring(5)); } ... public void registerRenders() { registerRender(mahogany_leaves); } blockstates/mahogany_leaves.json { "variants": { "normal": { "model": "em:mahogany_leaves" } } } models/block/mahogany_leaves.json { "parent": "block/cube_all", "textures": { "all": "em:blocks/mahogany_leaves" } } models/item/mahogany_leaves.json { "parent": "em:block/mahogany_leaves", "display": { "thirdperson": { "rotation": [ 10, -45, 170 ], "translation": [ 0, 1.5, -2.75 ], "scale": [ 0.375, 0.375, 0.375 ] } } } My texture is in the right folder as it shows up in my inventory. If anyone has any idea why it's not showing up, any help is welcome. I'm also sure there are better ways of creative a custom leaves class (with a VARIANT property for example). If you have a basic custom leaves class, I would gladly take a look at it to understand what's going on. Also, they do act like leaves. They decay, drop apples etc. so the registering should be fine. Probably something to do with my json files but I can't seem to figure out what. Thanks in advance, Krikke
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.