-
Notifications
You must be signed in to change notification settings - Fork 26
Expand file tree
/
Copy pathCelestialToggleItem.java
More file actions
35 lines (32 loc) · 1.5 KB
/
CelestialToggleItem.java
File metadata and controls
35 lines (32 loc) · 1.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
package net.modificationstation.sltest.item;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import net.modificationstation.sltest.celestial.CelestialListener;
import net.modificationstation.stationapi.api.template.item.TemplateItem;
import net.modificationstation.stationapi.api.util.Identifier;
public class CelestialToggleItem extends TemplateItem {
public CelestialToggleItem(Identifier identifier) {
super(identifier);
}
@Override
public ItemStack use(ItemStack item, World world, PlayerEntity player) {
if (CelestialListener.fallingDimando.isActive()) {
CelestialListener.fallingDimando.stopEvent(world);
System.out.println("Stopping Falling Dimando");
} else if (CelestialListener.fallingDimando.activateEvent(world, world.getTime(), random)) {
System.out.println("Activating Falling Dimando");
} else {
System.out.println("Falling Dimando not activated");
}
if (CelestialListener.flyingDimando.isActive()) {
CelestialListener.flyingDimando.stopEvent(world);
System.out.println("Stopping Flying Dimando");
} else if (CelestialListener.flyingDimando.activateEvent(world, world.getTime(), random)) {
System.out.println("Activating Flying Dimando");
} else {
System.out.println("Flying Dimando not activated");
}
return super.use(item, world, player);
}
}