mirror of
https://github.com/StarWishsama/Slimefun4.git
synced 2024-09-20 11:45:51 +00:00
Implementing postRegister() and doing the requested change.
This commit is contained in:
parent
5ed152b1e7
commit
9c9a3bb6ba
@ -261,6 +261,8 @@ public class SlimefunItem {
|
|||||||
if (this instanceof VanillaItem) this.state = State.VANILLA;
|
if (this instanceof VanillaItem) this.state = State.VANILLA;
|
||||||
else this.state = State.DISABLED;
|
else this.state = State.DISABLED;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
postRegister();
|
||||||
} catch(Exception x) {
|
} catch(Exception x) {
|
||||||
Slimefun.getLogger().log(Level.WARNING, "Registering the Item '" + id + "' for Slimefun " + Slimefun.getVersion() + " has failed", x);
|
Slimefun.getLogger().log(Level.WARNING, "Registering the Item '" + id + "' for Slimefun " + Slimefun.getVersion() + " has failed", x);
|
||||||
}
|
}
|
||||||
@ -506,6 +508,8 @@ public class SlimefunItem {
|
|||||||
ChargableBlock.registerCapacitor(id, capacity);
|
ChargableBlock.registerCapacitor(id, capacity);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void postRegister() {}
|
||||||
|
|
||||||
protected void setItem(ItemStack stack) {
|
protected void setItem(ItemStack stack) {
|
||||||
this.item = stack;
|
this.item = stack;
|
||||||
}
|
}
|
||||||
|
@ -25,6 +25,7 @@ import me.mrCookieSlime.Slimefun.utils.Utilities;
|
|||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
public class GrapplingHook extends SimpleSlimefunItem<ItemInteractionHandler> {
|
public class GrapplingHook extends SimpleSlimefunItem<ItemInteractionHandler> {
|
||||||
|
private long despawnTicks;
|
||||||
|
|
||||||
public GrapplingHook(Category category, ItemStack item, String id, RecipeType recipeType, ItemStack[] recipe, String[] keys, Object[] values) {
|
public GrapplingHook(Category category, ItemStack item, String id, RecipeType recipeType, ItemStack[] recipe, String[] keys, Object[] values) {
|
||||||
super(category, item, id, recipeType, recipe, keys, values);
|
super(category, item, id, recipeType, recipe, keys, values);
|
||||||
@ -76,11 +77,16 @@ public class GrapplingHook extends SimpleSlimefunItem<ItemInteractionHandler> {
|
|||||||
utilities.remove.remove(uuid);
|
utilities.remove.remove(uuid);
|
||||||
}, 20L);
|
}, 20L);
|
||||||
}
|
}
|
||||||
}, (int) Slimefun.getItemValue("GRAPPLING_HOOK", "despawn-seconds") * 20);
|
}, despawnTicks);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else return false;
|
else return false;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void postRegister() {
|
||||||
|
despawnTicks = (int) Slimefun.getItemValue("GRAPPLING_HOOK", "despawn-seconds") * 20;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user