Skip to content

Commit

Permalink
workbookは常にメインハンドでのみ使えるように
Browse files Browse the repository at this point in the history
  • Loading branch information
iesika committed Aug 23, 2017
1 parent 647af0a commit 04aef0e
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 20 deletions.
2 changes: 0 additions & 2 deletions src/main/java/com/iesika/aem/common/ai/EntityAIExport.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import net.blacklab.lmr.entity.EntityLittleMaid;
import net.blacklab.lmr.entity.mode.EntityModeBase;
import net.blacklab.lmr.util.EnumSound;
import net.minecraft.entity.SharedMonsterAttributes;
import net.minecraft.entity.ai.EntityAIBase;
import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.ISidedInventory;
Expand All @@ -31,7 +30,6 @@ public EntityAIExport(EntityLittleMaid owner) {
this.owner = owner;
this.opinv = false;
this.cflag = true;
owner.getEntityAttribute(SharedMonsterAttributes.FOLLOW_RANGE).setBaseValue(50);
setMutexBits(7);
}

Expand Down
2 changes: 0 additions & 2 deletions src/main/java/com/iesika/aem/common/ai/EntityAIImport.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import net.blacklab.lmr.entity.EntityLittleMaid;
import net.blacklab.lmr.entity.mode.EntityModeBase;
import net.blacklab.lmr.util.EnumSound;
import net.minecraft.entity.SharedMonsterAttributes;
import net.minecraft.entity.ai.EntityAIBase;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack;
Expand All @@ -31,7 +30,6 @@ public EntityAIImport(EntityLittleMaid owner) {
this.owner = owner;
this.opinv = false;
this.cflag = true;
owner.getEntityAttribute(SharedMonsterAttributes.FOLLOW_RANGE).setBaseValue(50);
setMutexBits(7);
}

Expand Down
19 changes: 3 additions & 16 deletions src/main/java/com/iesika/aem/mode/EntityModeCarrier.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ public class EntityModeCarrier extends EntityModeBase {
public static final int mmode_Carrier = 0x4201;
public static final String CarrierModeName = "Carrier";

public boolean useMainHand;
public MaidTaskManager maidTaskManager;

static {
Expand All @@ -29,7 +28,6 @@ public class EntityModeCarrier extends EntityModeBase {

public EntityModeCarrier(EntityLittleMaid maid) {
super(maid);
this.useMainHand = true;
}

@Override
Expand All @@ -39,25 +37,14 @@ public int priority() {

@Override
public boolean changeMode(EntityPlayer pentityplayer) {
//メインハンド優先
ItemStack mainHand = owner.maidInventory.mainHandInventory[0];
if (mainHand != null) {
if (mainHand.getItem() == AEMItems.workbook) {
if (mainHand != null){
if (shouldChangeToCarrierMode(mainHand)){
owner.setMaidMode(CarrierModeName);
useMainHand = true;
Logger.info("maid mode -> Carrier (use main hand)");
return true;
}
}
ItemStack offHand = owner.maidInventory.offHandInventory[0];
if (offHand != null) {
if (offHand.getItem() == AEMItems.workbook) {
owner.setMaidMode(CarrierModeName);
useMainHand = false;
Logger.info("maid mode -> Carrier (use off hand)");
return true;
}
}
return false;
}

Expand Down Expand Up @@ -85,7 +72,7 @@ public boolean setMode(int pMode) {
switch (pMode) {
case mmode_Carrier:
owner.setBloodsuck(false);
return shouldChangeToCarrierMode(useMainHand ? owner.maidInventory.mainHandInventory[0] : owner.maidInventory.offHandInventory[0]);
return shouldChangeToCarrierMode(owner.maidInventory.mainHandInventory[0]);
}
return false;
}
Expand Down

0 comments on commit 04aef0e

Please sign in to comment.