|
40 | 40 | import com.laytonsmith.abstraction.entities.MCCommandMinecart; |
41 | 41 | import com.laytonsmith.abstraction.entities.MCCreeper; |
42 | 42 | import com.laytonsmith.abstraction.entities.MCEnderDragon; |
| 43 | +import com.laytonsmith.abstraction.entities.MCEnderSignal; |
43 | 44 | import com.laytonsmith.abstraction.entities.MCEnderman; |
44 | 45 | import com.laytonsmith.abstraction.entities.MCEvokerFangs; |
45 | 46 | import com.laytonsmith.abstraction.entities.MCFallingBlock; |
@@ -1849,6 +1850,14 @@ public Construct exec(Target t, Environment environment, Construct... args) thro |
1849 | 1850 | } |
1850 | 1851 | } |
1851 | 1852 | break; |
| 1853 | + case ENDER_EYE: |
| 1854 | + if(Static.getServer().getMinecraftVersion().gte(MCVersion.MC1_12_X)) { |
| 1855 | + MCEnderSignal endereye = (MCEnderSignal) entity; |
| 1856 | + specArray.set(entity_spec.KEY_ENDEREYE_DESPAWNTICKS, new CInt(endereye.getDespawnTicks(), t), t); |
| 1857 | + specArray.set(entity_spec.KEY_ENDEREYE_DROP, CBoolean.get(endereye.getDropItem()), t); |
| 1858 | + specArray.set(entity_spec.KEY_ENDEREYE_TARGET, ObjectGenerator.GetGenerator().location(endereye.getTargetLocation(), false), t); |
| 1859 | + } |
| 1860 | + break; |
1852 | 1861 | case ENDER_DRAGON: |
1853 | 1862 | MCEnderDragon enderdragon = (MCEnderDragon) entity; |
1854 | 1863 | if(Static.getServer().getMinecraftVersion().gte(MCVersion.MC1_9_X)) { |
@@ -2113,6 +2122,9 @@ public CHVersion since() { |
2113 | 2122 | private static final String KEY_DROPPED_ITEM_PICKUPDELAY = "pickupdelay"; |
2114 | 2123 | private static final String KEY_ENDERCRYSTAL_BASE = "base"; |
2115 | 2124 | private static final String KEY_ENDERCRYSTAL_BEAMTARGET = "beamtarget"; |
| 2125 | + private static final String KEY_ENDEREYE_DESPAWNTICKS = "despawnticks"; |
| 2126 | + private static final String KEY_ENDEREYE_DROP = "drop"; |
| 2127 | + private static final String KEY_ENDEREYE_TARGET = "target"; |
2116 | 2128 | private static final String KEY_ENDERDRAGON_PHASE = "phase"; |
2117 | 2129 | private static final String KEY_ENDERMAN_CARRIED = "carried"; |
2118 | 2130 | private static final String KEY_EXPERIENCE_ORB_AMOUNT = "amount"; |
@@ -2181,7 +2193,7 @@ public String getName() { |
2181 | 2193 | public Class<? extends CREThrowable>[] thrown() { |
2182 | 2194 | return new Class[]{CRECastException.class, CREBadEntityException.class, CREIndexOverflowException.class, |
2183 | 2195 | CREIndexOverflowException.class, CRERangeException.class, CREFormatException.class, |
2184 | | - CRELengthException.class}; |
| 2196 | + CRELengthException.class, CREInvalidWorldException.class}; |
2185 | 2197 | } |
2186 | 2198 |
|
2187 | 2199 | @Override |
@@ -2482,6 +2494,32 @@ public Construct exec(Target t, Environment environment, Construct... args) thro |
2482 | 2494 | } |
2483 | 2495 | } |
2484 | 2496 | break; |
| 2497 | + case ENDER_EYE: |
| 2498 | + MCEnderSignal endereye = (MCEnderSignal) entity; |
| 2499 | + // Order matters here. Target must be set first or it will reset despawn ticks and drop. |
| 2500 | + if(specArray.containsKey(entity_spec.KEY_ENDEREYE_TARGET)) { |
| 2501 | + Construct targetLoc = specArray.get(entity_spec.KEY_ENDEREYE_TARGET, t); |
| 2502 | + try { |
| 2503 | + endereye.setTargetLocation(ObjectGenerator.GetGenerator().location(targetLoc, null, t)); |
| 2504 | + } catch (IllegalArgumentException ex) { |
| 2505 | + throw new CREInvalidWorldException("An EnderEye cannot target a location in another world.", t); |
| 2506 | + } |
| 2507 | + } |
| 2508 | + for(String index : specArray.stringKeySet()) { |
| 2509 | + switch(index.toLowerCase()) { |
| 2510 | + case entity_spec.KEY_ENDEREYE_DESPAWNTICKS: |
| 2511 | + endereye.setDespawnTicks(Static.getInt32(specArray.get(index, t), t)); |
| 2512 | + break; |
| 2513 | + case entity_spec.KEY_ENDEREYE_DROP: |
| 2514 | + endereye.setDropItem(Static.getBoolean(specArray.get(index, t), t)); |
| 2515 | + break; |
| 2516 | + case entity_spec.KEY_ENDEREYE_TARGET: |
| 2517 | + break; |
| 2518 | + default: |
| 2519 | + throwException(index, t); |
| 2520 | + } |
| 2521 | + } |
| 2522 | + break; |
2485 | 2523 | case ENDERMAN: |
2486 | 2524 | MCEnderman enderman = (MCEnderman) entity; |
2487 | 2525 | for(String index : specArray.stringKeySet()) { |
|
0 commit comments