Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/compilable 1.11.2 #50

Merged
merged 2 commits into from Sep 6, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/main/java/info/ata4/minecraft/dragon/DragonMounts.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
public class DragonMounts {

public static final String NAME = "Dragon Mounts";
public static final String ID = "DragonMounts";
public static final String ID = "dragonmounts";
public static final String AID = ID.toLowerCase();
public static final String VERSION = "@VERSION@";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ protected void renderEgg(EntityTameableDragon dragon, double x, double y, double
}

@Override
protected void rotateCorpse(EntityTameableDragon dragon, float par2, float par3, float par4) {
protected void applyRotations(EntityTameableDragon dragon, float par2, float par3, float par4) {
GlStateManager.rotate(180 - par3, 0, 1, 0);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.NonNullList;

/**
*
Expand Down Expand Up @@ -58,7 +59,7 @@ public int getMetaFromState(IBlockState state) {
}

@Override
public void getSubBlocks(Item itemIn, CreativeTabs tab, List<ItemStack> list) {
public void getSubBlocks(Item itemIn, CreativeTabs tab, NonNullList<ItemStack> list) {
EnumDragonBreed.META_MAPPING.values().forEach(index -> list.add(new ItemStack(itemIn, 1, index)));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,12 @@
import info.ata4.minecraft.dragon.server.entity.helper.EnumDragonLifeStage;
import net.minecraft.block.Block;
import net.minecraft.block.state.IBlockState;
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.util.EnumHand;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import net.minecraftforge.event.entity.player.PlayerInteractEvent;
Expand All @@ -38,8 +43,8 @@ public void onPlayerInteract(PlayerInteractEvent evt) {
// if (evt.action != PlayerInteractEvent.Action.RIGHT_CLICK_BLOCK) {
// return;
// }
BlockPos pos = evt.getPos();

BlockPos pos = evt.getPos();
World world = evt.getWorld();
IBlockState state = world.getBlockState(pos);
Block block = world.getBlockState(pos).getBlock();
Expand All @@ -55,6 +60,15 @@ public void onPlayerInteract(PlayerInteractEvent evt) {
return;
}

EntityPlayer player = evt.getEntityPlayer();
if( player == null )
return;
ItemStack heldItem = player.getHeldItem(EnumHand.MAIN_HAND);
if( heldItem == null )
return;
if( heldItem.getItem() != Items.FLINT_AND_STEEL )
return;

// deny action
evt.setResult(Event.Result.DENY);

Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/mcmod.info
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[
{
"modid" : "DragonMounts",
"modid" : "dragonmounts",
"name" : "Dragon Mounts",
"description": "A mod that allows you to breed dragon eggs and foster them to ridable dragons.",
"version": "${version}",
Expand Down