Skip to content

Commit bd98b63

Browse files
committed
AetherMP addon stage
A complete rewrite of AetherMP. Client side now doesn't include any original mod code and works as an addon to it. Server side has massive changes so it doesn't look like original client mod.
1 parent af300ea commit bd98b63

120 files changed

Lines changed: 9089 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
/backups/
2+
/bin/
3+
/conf/
4+
/docs/
5+
/eclipse/*
6+
!/eclipse/CraftBukkit/
7+
/eclipse/CraftBukkit/*
8+
!/eclipse/CraftBukkit/src/
9+
/jars/
10+
/lib/
11+
/logs/
12+
/reobf/
13+
/runtime/
14+
/src/minecraft_server/
15+
/src/minecraft/net/minecraft/*
16+
!/src/minecraft/net/minecraft/src/
17+
/src/minecraft/net/minecraft/src/*
18+
!/src/minecraft/net/minecraft/src/mod_AetherMp.java
19+
/temp/
20+
/versions/
21+
cleanup.bat
22+
decompile.bat
23+
recompile.bat
24+
reobfuscate.bat
25+
setup.bat
26+
startclient.bat
27+
startserver.bat
28+
updatemcp.bat
29+
updatemd5.bat
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
package net.mine_diver.aethermp;
2+
3+
import net.mine_diver.aethermp.blocks.BlockManager;
4+
import net.mine_diver.aethermp.crafting.WorkbenchManager;
5+
import net.mine_diver.aethermp.dimension.DimensionManager;
6+
import net.mine_diver.aethermp.entities.EntityManager;
7+
import net.mine_diver.aethermp.items.ItemManager;
8+
import net.mine_diver.aethermp.player.PlayerBaseAether;
9+
import net.mine_diver.aethermp.util.BlockPlacementHandler;
10+
import net.minecraft.server.PlayerAPI;
11+
import net.minecraft.server.SAPI;
12+
13+
public class Core {
14+
15+
public void postInit() {
16+
BlockManager.registerBlocks();
17+
ItemManager.registerItems();
18+
WorkbenchManager.registerRecipes();
19+
EntityManager.registerEntities();
20+
SAPI.interceptAdd(new BlockPlacementHandler());
21+
PlayerAPI.RegisterPlayerBase(PlayerBaseAether.class);
22+
DimensionManager.registerDimensions();
23+
}
24+
}
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
package net.mine_diver.aethermp.blocks;
2+
3+
import net.minecraft.server.AxisAlignedBB;
4+
import net.minecraft.server.Block;
5+
import net.minecraft.server.Entity;
6+
import net.minecraft.server.EntityHuman;
7+
import net.minecraft.server.Material;
8+
import net.minecraft.server.World;
9+
10+
public class BlockAercloud extends Block {
11+
12+
protected BlockAercloud(int ID) {
13+
super(ID, Material.ICE);
14+
}
15+
16+
@Override
17+
public void a(World world, int i, int j, int k, Entity entity) {
18+
entity.fallDistance = 0.0F;
19+
if(world.getData(i, j, k) == 1) {
20+
entity.motY = 2D;
21+
if(entity instanceof EntityHuman) {
22+
//mod_Aether.giveAchievement(AetherAchievements.blueCloud, (EntityPlayer)entity);
23+
}
24+
} else if(entity.motY < 0.0D)
25+
entity.motY *= 0.0050000000000000001D;
26+
}
27+
28+
@Override
29+
public boolean a() {
30+
return false;
31+
}
32+
33+
@Override
34+
protected int a_(int i) {
35+
return i;
36+
}
37+
38+
@Override
39+
public AxisAlignedBB e(World world, int i, int j, int k) {
40+
if(world.getData(i, j, k) == 1)
41+
return AxisAlignedBB.b(i, j, k, i, j, k);
42+
else
43+
return AxisAlignedBB.b(i, j, k, i + 1, j, k + 1);
44+
}
45+
46+
public static final int bouncingMeta = 1;
47+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
package net.mine_diver.aethermp.blocks;
2+
3+
import net.minecraft.server.Block;
4+
import net.minecraft.server.Material;
5+
6+
public class BlockAerogel extends Block {
7+
8+
public BlockAerogel(int blockID) {
9+
super(blockID, -1, Material.STONE);
10+
}
11+
12+
public boolean isOpaqueCube() {
13+
return false;
14+
}
15+
}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
package net.mine_diver.aethermp.blocks;
2+
3+
import net.mine_diver.aethermp.items.ItemManager;
4+
import net.minecraft.server.Block;
5+
import net.minecraft.server.EntityHuman;
6+
import net.minecraft.server.Material;
7+
import net.minecraft.server.StatisticList;
8+
import net.minecraft.server.World;
9+
10+
public class BlockAetherDirt extends Block {
11+
12+
protected BlockAetherDirt(int ID){
13+
super(ID, Material.EARTH);
14+
}
15+
16+
@Override
17+
public boolean a() {
18+
return true;
19+
}
20+
21+
@Override
22+
public void postPlace(World world, int i, int j, int k, int l) {
23+
world.setTypeId(i, j, k, id);
24+
world.setData(i, j, k, 1);
25+
}
26+
27+
@Override
28+
public void a(World world, EntityHuman entityhuman, int i, int j, int k, int l) {
29+
entityhuman.a(StatisticList.C[id], 1);
30+
if(l == 0 && ItemManager.equippedSkyrootShovel(entityhuman))
31+
g(world, i, j, k, l);
32+
g(world, i, j, k, l);
33+
}
34+
}
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
package net.mine_diver.aethermp.blocks;
2+
3+
import java.util.Random;
4+
5+
import net.minecraft.server.AxisAlignedBB;
6+
import net.minecraft.server.Block;
7+
import net.minecraft.server.Material;
8+
import net.minecraft.server.World;
9+
10+
public class BlockAetherFlower extends Block {
11+
12+
protected BlockAetherFlower(int i) {
13+
super(i, Material.PLANT);
14+
a(true);
15+
float f = 0.2F;
16+
a(0.5F - f, 0.0F, 0.5F - f, 0.5F + f, f * 3F, 0.5F + f);
17+
}
18+
19+
@Override
20+
public boolean canPlace(World world, int i, int j, int k) {
21+
return super.canPlace(world, i, j, k) && canThisPlantGrowOnThisBlockID(world.getTypeId(i, j - 1, k));
22+
}
23+
24+
protected boolean canThisPlantGrowOnThisBlockID(int i) {
25+
return i == BlockManager.Grass.id || i == BlockManager.Dirt.id;
26+
}
27+
28+
@Override
29+
public void doPhysics(World world, int i, int j, int k, int l) {
30+
super.doPhysics(world, i, j, k, l);
31+
checkFlowerChange(world, i, j, k);
32+
}
33+
34+
@Override
35+
public void a(World world, int i, int j, int k, Random random) {
36+
checkFlowerChange(world, i, j, k);
37+
}
38+
39+
protected final void checkFlowerChange(World world, int i, int j, int k) {
40+
if(!f(world, i, j, k)) {
41+
g(world, i, j, k, world.getData(i, j, k));
42+
world.setTypeId(i, j, k, 0);
43+
}
44+
}
45+
46+
@Override
47+
public boolean f(World world, int i, int j, int k) {
48+
return (world.k(i, j, k) >= 8 || world.isChunkLoaded(i, j, k)) && canThisPlantGrowOnThisBlockID(world.getTypeId(i, j - 1, k));
49+
}
50+
51+
@Override
52+
public AxisAlignedBB e(World world, int i, int j, int k) {
53+
return null;
54+
}
55+
56+
@Override
57+
public boolean a() {
58+
return false;
59+
}
60+
61+
@Override
62+
public boolean b() {
63+
return false;
64+
}
65+
}
Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
package net.mine_diver.aethermp.blocks;
2+
3+
import java.util.Random;
4+
5+
import net.mine_diver.aethermp.items.ItemManager;
6+
import net.minecraft.server.Block;
7+
import net.minecraft.server.EntityHuman;
8+
import net.minecraft.server.Item;
9+
import net.minecraft.server.ItemStack;
10+
import net.minecraft.server.Material;
11+
import net.minecraft.server.StatisticList;
12+
import net.minecraft.server.World;
13+
import net.minecraft.server.mod_AetherMp;
14+
15+
public class BlockAetherGrass extends Block {
16+
17+
protected BlockAetherGrass(int ID) {
18+
super(ID, Material.EARTH);
19+
a(true);
20+
}
21+
22+
@Override
23+
public void a(World world, int i, int j, int k, Random random) {
24+
if (world.getLightLevel(i, j + 1, k) < 4 && Block.q[world.getTypeId(i, j + 1, k)] > 2) {
25+
if (random.nextInt(4) != 0)
26+
return;
27+
world.setTypeId(i, j, k, BlockManager.Dirt.id);
28+
} else if (world.getLightLevel(i, j + 1, k) >= 9) {
29+
int l = i + random.nextInt(3) - 1;
30+
int i1 = j + random.nextInt(5) - 3;
31+
int j1 = k + random.nextInt(3) - 1;
32+
int k1 = world.getTypeId(l, i1 + 1, j1);
33+
if (world.getTypeId(l, i1, j1) == BlockManager.Dirt.id && world.getLightLevel(l, i1 + 1, j1) >= 4 && Block.q[k1] <= 2)
34+
world.setTypeId(l, i1, j1, BlockManager.Grass.id);
35+
}
36+
}
37+
38+
@Override
39+
public int a(int i, Random random) {
40+
return BlockManager.Dirt.a(0, random);
41+
}
42+
43+
@Override
44+
public void a(World world, EntityHuman entityhuman, int i, int j, int k, int l) {
45+
entityhuman.a(StatisticList.C[id], 1);
46+
if(l == 0 && ItemManager.equippedSkyrootShovel(entityhuman))
47+
g(world, i, j, k, l);
48+
g(world, i, j, k, l);
49+
}
50+
51+
@Override
52+
public boolean interact(World world, int i, int j, int k, EntityHuman entityhuman) {
53+
if(entityhuman == null)
54+
return false;
55+
ItemStack itemstack = entityhuman.G();
56+
if(itemstack == null)
57+
return false;
58+
if(itemstack.id != Item.INK_SACK.id)
59+
return false;
60+
if(itemstack.getData() != 15)
61+
return false;
62+
itemstack.count--;
63+
int l = 0;
64+
label0:
65+
for(int i1 = 0; i1 < 64; i1++) {
66+
int j1 = i;
67+
int k1 = j + 1;
68+
int l1 = k;
69+
for(int i2 = 0; i2 < i1 / 16; i2++) {
70+
j1 += world.random.nextInt(3) - 1;
71+
k1 += ((world.random.nextInt(3) - 1) * world.random.nextInt(3)) / 2;
72+
l1 += world.random.nextInt(3) - 1;
73+
if(world.getTypeId(j1, k1 - 1, l1) != id || world.e(j1, k1, l1))
74+
continue label0;
75+
}
76+
77+
if(world.getTypeId(j1, k1, l1) != 0)
78+
continue;
79+
if(world.random.nextInt(20 + 10 * l) == 0) {
80+
world.setTypeId(j1, k1, l1, mod_AetherMp.idBlockWhiteFlower);
81+
l++;
82+
continue;
83+
}
84+
if(world.random.nextInt(10 + 2 * l) <= 2) {
85+
world.setTypeId(j1, k1, l1, mod_AetherMp.idBlockPurpleFlower);
86+
l++;
87+
}
88+
}
89+
90+
return true;
91+
}
92+
}

0 commit comments

Comments
 (0)