Skip to content

Commit

Permalink
Fixed Bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
trychen committed Jul 15, 2017
1 parent c7d66d7 commit d9860ce
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 33 deletions.
10 changes: 3 additions & 7 deletions src/main/java/unstudio/chinacraft/common/Recipes.java
Original file line number Diff line number Diff line change
Expand Up @@ -259,10 +259,7 @@ public static void init() {
new Object[]{" ##", " X#", "X ", '#', ChinaCraft.bronzeIngot, 'X', Items.stick}));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ChinaCraft.bronzeBroadSword, 1),
new Object[]{" ##", " X#", "X ", '#', ChinaCraft.bronzeIngot, 'X', Items.stick}));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ChinaCraft.blGiantSword, 1),
new Object[]{"#B#", "EDE", "CAC", '#', Item.getItemFromBlock(Blocks.obsidian), 'A', Items.stick, 'B',
Items.lava_bucket.setContainerItem(Items.bucket), 'C', Items.iron_ingot, 'D',
Item.getItemFromBlock(Blocks.soul_sand), 'E', ChinaCraft.bronzeBlock}));

GameRegistry.addRecipe(new ItemStack(ChinaCraft.bronzePickaxe, 1),
new Object[]{"###", " X ", " X ", '#', ChinaCraft.bronzeIngot, 'X', Items.stick});
GameRegistry.addRecipe(new ItemStack(ChinaCraft.bronzeAxe, 1),
Expand All @@ -288,13 +285,12 @@ public static void init() {

// 冕冠
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ChinaCraft.chinaCrown, 1),
"TET",
"T#T",
"#X#",
"S#S",
'#', Items.gold_ingot,
'X', Items.nether_star.setContainerItem(Items.nether_star),
'X', Items.nether_star,
'T', new ItemStack(ChinaCraft.itemSilk, 1, 12),
'E', Item.getItemFromBlock(Blocks.dragon_egg).setContainerItem(Item.getItemFromBlock(Blocks.dragon_egg)),
'S', new ItemStack(ChinaCraft.itemSilk, 1, 14)));

// TinOre
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
*/
public class ModelArmorCassock extends ModelArmor {
@SideOnly(Side.CLIENT)
private ModelCassock armorModel = new ModelCassock();
private Object armorModel;

private static Integer itemId;

Expand All @@ -28,38 +28,38 @@ public ModelArmorCassock() {
@Override
@SideOnly(Side.CLIENT)
public ModelBiped getArmorModel(EntityLivingBase entityLiving, ItemStack itemStack, int armorSlot) {
if (armorModel != null) {
armorModel = new ModelCassock();
armorModel.bipedBody.showModel = true;
armorModel.bipedRightArm.showModel = true;
armorModel.bipedLeftArm.showModel = true;
armorModel.bipedRightLeg.showModel = true;
armorModel.bipedLeftLeg.showModel = true;
if (armorModel == null) armorModel = new ModelCassock();
ModelCassock model = (ModelCassock) armorModel;
model = new ModelCassock();
model.bipedBody.showModel = true;
model.bipedRightArm.showModel = true;
model.bipedLeftArm.showModel = true;
model.bipedRightLeg.showModel = true;
model.bipedLeftLeg.showModel = true;

armorModel.isSneak = entityLiving.isSneaking();
armorModel.isRiding = entityLiving.isRiding();
armorModel.isChild = entityLiving.isChild();
model.isSneak = entityLiving.isSneaking();
model.isRiding = entityLiving.isRiding();
model.isChild = entityLiving.isChild();

armorModel.heldItemRight = 0;
armorModel.aimedBow = false;
model.heldItemRight = 0;
model.aimedBow = false;

EntityPlayer player = (EntityPlayer) entityLiving;
EntityPlayer player = (EntityPlayer) entityLiving;

ItemStack held_item = player.getEquipmentInSlot(0);
ItemStack held_item = player.getEquipmentInSlot(0);

if (held_item != null) {
armorModel.heldItemRight = 1;
if (player.getItemInUseCount() > 0) {
EnumAction enumaction = held_item.getItemUseAction();
if (enumaction == EnumAction.bow) {
armorModel.aimedBow = true;
} else if (enumaction == EnumAction.block) {
armorModel.heldItemRight = 3;
}
if (held_item != null) {
model.heldItemRight = 1;
if (player.getItemInUseCount() > 0) {
EnumAction enumaction = held_item.getItemUseAction();
if (enumaction == EnumAction.bow) {
model.aimedBow = true;
} else if (enumaction == EnumAction.block) {
model.heldItemRight = 3;
}
}
}
return armorModel;
return model;
}

@Override
Expand All @@ -69,7 +69,7 @@ public String getArmorTexture(ItemStack stack, Entity entity, int slot, String l
}

public static int getItemId() {
if (itemId == null){
if (itemId == null) {
itemId = Item.getIdFromItem(ChinaCraft.cassock);
}
return itemId;
Expand Down

0 comments on commit d9860ce

Please sign in to comment.