Skip to content

Commit e6b8d50

Browse files
LoneDev6MelonCode
authored andcommitted
Optimization (MelonCode#9)
* Update Main.java * Update MagicTree.java Optimization. Now chunk won't be loaded in RAM if it's not already loaded. * Update config.yml Fixed missing config values * Create README.md Info * Update README.md
1 parent 7ef02f1 commit e6b8d50

4 files changed

Lines changed: 22 additions & 4 deletions

File tree

README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# X-Mas
2+
3+
![Image](http://puu.sh/dKlK1/85c3dad454.jpg)
4+
5+
With this plugin you can plant your Christmas tree and upgrade it. Look for some gifts under it!
6+
7+
[SpigotMC plugin page](https://www.spigotmc.org/resources/x-mas-upgradeable-christmas-tree-event.2672/)
8+
9+
## Authors
10+
11+
* **MelonCode** - *Original dev* - [MelonCode](https://github.com/MelonCode)
12+
* **Ghost_chu** - *NMS fixes* - [Ghost_chu](https://github.com/Ghost-chu)
13+
* **LoneDev6** - *Optimization patches* - [LoneDev6](https://github.com/LoneDev6)
14+
* **montlikadani** - *Translation (hu)* - [montlikadani](https://github.com/montlikadani)
15+
16+
See also the list of [contributors](https://github.com/MelonCode/X-Mas/graphs/contributors) who participated in this project.

src/main/java/ru/meloncode/xmas/MagicTree.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ public void playParticles()
113113
{
114114
if (blocks != null && blocks.size() > 0) {
115115
for (Block block : blocks) {
116-
if(!block.getChunk().isLoaded())
116+
if(!block.getWorld().isChunkLoaded(block.getX() / 16, block.getZ() / 16))
117117
continue;
118118
if (block.getType() == Material.SPRUCE_LEAVES) {
119119
if (level.getSwagEffect() != null) {

src/main/java/ru/meloncode/xmas/Main.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ public void onEnable() {
128128
LUCK_CHANCE = (float) config.getInt("xmas.luck.chance") / 100;
129129
new Events().registerListener();
130130
new MagicTask(this).runTaskTimer(this, 5, TASK_DELAY);
131-
new MagicTaskParticles(this).runTaskTimer(this, 5, PARTICLES_DELAY);
131+
new MagicTaskParticles(this).runTaskTimerAsynchronously(this, 5, PARTICLES_DELAY);
132132
XMas.XMAS_CRYSTAL = new ItemMaker(Material.EMERALD, LocaleManager.CRYSTAL_NAME, LocaleManager.CRYSTAL_LORE).make();
133133

134134
ShapedRecipe grinderRecipe;

src/main/resources/config.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@ core:
1919
#I don't Recommend to touch it.
2020
#20 = 1 update / sec
2121
#Can't be 0
22-
update-speed: 7
22+
update-speed: 7
23+
task-delay: 7
24+
particles-delay: 35
2325
xmas:
2426
luck:
2527
enabled: false
@@ -74,4 +76,4 @@ xmas:
7476
GLOWSTONE_DUST: 16
7577
magic_tree:
7678
gift-cooldown: 120
77-
lvlup:
79+
lvlup:

0 commit comments

Comments
 (0)