Skip to content

Commit

Permalink
Updating README.md for source of hMod and Bukkit
Browse files Browse the repository at this point in the history
  • Loading branch information
shadow386 committed Mar 11, 2011
1 parent 7a87ff5 commit 38e01ae
Show file tree
Hide file tree
Showing 52 changed files with 175 additions and 175 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
hMod
CanaryMod
====================
hMod is a server mod for the Minecraft Beta server software. This is only the source code, if you don't know how to use this you won't find it useful.
CanaryMod is a server mod for the Minecraft Beta server software that uses the code from hMod and some from bukkit. This is only the source code, if you don't know how to use this you won't find it useful.

Compiling
---------
Expand Down
4 changes: 2 additions & 2 deletions build-jar.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<project name="hMod JarFile Compiler" default="jar" basedir=".">
<project name="CanaryMod JarFile Compiler" default="jar" basedir=".">
<description>
This script will build the hMod jarfile.
This script will build the CanaryMod jarfile.
</description>

<property name="src" location="src" />
Expand Down
6 changes: 3 additions & 3 deletions build.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<project name="hMod Full Package Compiler" default="dist" basedir=".">
<project name="CanaryMod Full Package Compiler" default="dist" basedir=".">
<description>
This script will build the hMod jarfile and zip appropriate files.
This script will build the CanaryMod jarfile and zip appropriate files.
</description>

<property name="src" location="src" />
Expand Down Expand Up @@ -67,7 +67,7 @@
<include name="*.txt" />
</fileset>
</copy>
<zip destfile="${dist}/hMod.zip" basedir="${dist}" />
<zip destfile="${dist}/CanaryMod.zip" basedir="${dist}" />
</target>

<target name="clean" description="Remove the output directories">
Expand Down
2 changes: 1 addition & 1 deletion formatting.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<profiles version="11">
<profile kind="CodeFormatterProfile" name="hMod" version="11">
<profile kind="CodeFormatterProfile" name="CanaryMod" version="11">
<setting id="org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters" value="do not insert"/>
Expand Down
2 changes: 1 addition & 1 deletion src/DeadLockDetector.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public class DeadLockDetector extends Thread {
public DeadLockDetector() {
super("DeadLockDetector");
tmx = ManagementFactory.getThreadMXBean();
_log.info("hMod: Deadlock Detector Thread initialized.");
_log.info("CanaryMod: Deadlock Detector Thread initialized.");
}

@Override
Expand Down
2 changes: 1 addition & 1 deletion src/Digging.java
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public boolean d(int x, int y, int z) {
* @return
*/
public boolean a(OEntityPlayer player, OWorld world, OItemStack item, Block blockToPlace, Block blockClicked) {
// hMod: only call this hook if we're not using buckets/signs
// CanaryMod: only call this hook if we're not using buckets/signs
if (item != null)
if (item.a > 0 && item.c != Item.Type.Sign.getId() && item.c != Item.Type.Bucket.getId() && item.c != Item.Type.WaterBucket.getId() && item.c != Item.Type.LavaBucket.getId())
if (player instanceof OEntityPlayerMP && (Boolean) etc.getLoader().callHook(PluginLoader.Hook.ITEM_USE, ((OEntityPlayerMP) player).getPlayer(), blockToPlace, blockClicked, new Item(item)))
Expand Down
4 changes: 2 additions & 2 deletions src/OBlockButton.java
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ public boolean a(OWorld paramOWorld, int paramInt1, int paramInt2, int paramInt3
return true;
}

// hMod: Allow button to provide power
// CanaryMod: Allow button to provide power
int change = (Integer) etc.getLoader().callHook(PluginLoader.Hook.REDSTONE_CHANGE, new Block(bk, paramInt1, paramInt2, paramInt3), 0, 1);
if (change == 0)
return true;
Expand Down Expand Up @@ -239,7 +239,7 @@ public void a(OWorld paramOWorld, int paramInt1, int paramInt2, int paramInt3, R
return;
}

// hMod: Allow button to provide power
// CanaryMod: Allow button to provide power
int change = (Integer) etc.getLoader().callHook(PluginLoader.Hook.REDSTONE_CHANGE, new Block(bk, paramInt1, paramInt2, paramInt3), 1, 0);
if (change > 0)
return;
Expand Down
2 changes: 1 addition & 1 deletion src/OBlockCactus.java
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public boolean f(OWorld paramOWorld, int paramInt1, int paramInt2, int paramInt3

@Override
public void a(OWorld paramOWorld, int paramInt1, int paramInt2, int paramInt3, OEntity paramOEntity) {
// hMod Damage hook: Cactus
// CanaryMod Damage hook: Cactus
if (paramOEntity instanceof OEntityLiving && (Boolean) etc.getLoader().callHook(PluginLoader.Hook.DAMAGE, PluginLoader.DamageType.CACTUS, null, new LivingEntity((OEntityLiving) paramOEntity), 1))
return;
paramOEntity.a((OEntity) null, 1);
Expand Down
8 changes: 4 additions & 4 deletions src/OBlockFire.java
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public void a(OWorld paramOWorld, int paramInt1, int paramInt2, int paramInt3, R

int i2 = h(paramOWorld, k, n, m);
if ((i2 > 0) && (paramRandom.nextInt(i1) <= i2)) {
// hMod: dynamic spreading of fire.{
// CanaryMod: dynamic spreading of fire.{
// avg call amount per placed block of fire ~ 4
Block block = new Block(paramOWorld.a(k, n, m), k, n, m);
block.setStatus(3);
Expand All @@ -111,13 +111,13 @@ private void a(OWorld paramOWorld, int paramInt1, int paramInt2, int paramInt3,
if (paramRandom.nextInt(paramInt4) < i) {
int j = paramOWorld.a(paramInt1, paramInt2, paramInt3) == OBlock.am.bk ? 1 : 0;
if (paramRandom.nextInt(2) == 0) {
// hMod: VERY SLOW dynamic spreading of fire.
// CanaryMod: VERY SLOW dynamic spreading of fire.
Block block = new Block(paramOWorld.a(paramInt1, paramInt2, paramInt3), paramInt1, paramInt2, paramInt3);
block.setStatus(3);
if (!(Boolean) etc.getLoader().callHook(PluginLoader.Hook.IGNITE, block, null))
paramOWorld.e(paramInt1, paramInt2, paramInt3, bk);
} else {
// hMod: fire destroying a block.
// CanaryMod: fire destroying a block.
Block block = new Block(paramOWorld.a(paramInt1, paramInt2, paramInt3), paramInt1, paramInt2, paramInt3);
block.setStatus(4);
if (!(Boolean) etc.getLoader().callHook(PluginLoader.Hook.IGNITE, block, null))
Expand All @@ -130,7 +130,7 @@ private void a(OWorld paramOWorld, int paramInt1, int paramInt2, int paramInt3,
}

private boolean g(OWorld paramOWorld, int paramInt1, int paramInt2, int paramInt3) {
// hMod: cast down to fix decompiler error.(6 times)
// CanaryMod: cast down to fix decompiler error.(6 times)
if (b((OIBlockAccess) paramOWorld, paramInt1 + 1, paramInt2, paramInt3)) {
return true;
}
Expand Down
8 changes: 4 additions & 4 deletions src/OBlockFlowing.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ private void i(OWorld paramOWorld, int paramInt1, int paramInt2, int paramInt3)

@Override
public void a(OWorld paramOWorld, int paramInt1, int paramInt2, int paramInt3, Random paramRandom) {
// hMod: Store originating block
// CanaryMod: Store originating block
Block blockFrom = new Block(bk, paramInt1, paramInt2, paramInt3);

int i = g(paramOWorld, paramInt1, paramInt2, paramInt3);
Expand Down Expand Up @@ -79,7 +79,7 @@ public void a(OWorld paramOWorld, int paramInt1, int paramInt2, int paramInt3, R
i(paramOWorld, paramInt1, paramInt2, paramInt3);
}
if (l(paramOWorld, paramInt1, paramInt2 - 1, paramInt3)) {
// hMod: downwards flow.
// CanaryMod: downwards flow.
Block blockTo = new Block(0, paramInt1, paramInt2 - 1, paramInt3);
if (!(Boolean) etc.getLoader().callHook(PluginLoader.Hook.FLOW, blockFrom, blockTo))
if (i >= 8) {
Expand All @@ -96,7 +96,7 @@ public void a(OWorld paramOWorld, int paramInt1, int paramInt2, int paramInt3, R
if (n >= 8) {
return;
}
// hMod: sidewards flow.
// CanaryMod: sidewards flow.
if (arrayOfBoolean[0]) {
Block blockTo = new Block(0, paramInt1 - 1, paramInt2, paramInt3);
if (!(Boolean) etc.getLoader().callHook(PluginLoader.Hook.FLOW, blockFrom, blockTo))
Expand Down Expand Up @@ -253,7 +253,7 @@ protected int f(OWorld paramOWorld, int paramInt1, int paramInt2, int paramInt3,
}

private boolean l(OWorld paramOWorld, int paramInt1, int paramInt2, int paramInt3) {
// hMod: See if this liquid can destroy this block.
// CanaryMod: See if this liquid can destroy this block.
Block block = new Block(paramOWorld.a(paramInt1, paramInt2, paramInt3), paramInt1, paramInt2, paramInt3);
PluginLoader.HookResult ret = (PluginLoader.HookResult) etc.getLoader().callHook(PluginLoader.Hook.LIQUID_DESTROY, bk, block);
if (ret == PluginLoader.HookResult.PREVENT_ACTION)
Expand Down
2 changes: 1 addition & 1 deletion src/OBlockLeaves.java
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ public void a(OWorld paramOWorld, int paramInt1, int paramInt2, int paramInt3, R
}

private void g(OWorld paramOWorld, int paramInt1, int paramInt2, int paramInt3) {
// hMod: stop leaves from decaying
// CanaryMod: stop leaves from decaying
Block block = new Block(etc.getServer().getBlockIdAt(paramInt1, paramInt2, paramInt3), paramInt1, paramInt2, paramInt3);
if (!(Boolean) etc.getLoader().callHook(PluginLoader.Hook.LEAF_DECAY, block)) {
b_(paramOWorld, paramInt1, paramInt2, paramInt3, paramOWorld.b(paramInt1, paramInt2, paramInt3));
Expand Down
2 changes: 1 addition & 1 deletion src/OBlockLever.java
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ public boolean a(OWorld paramOWorld, int paramInt1, int paramInt2, int paramInt3
int j = i & 0x7;
int k = 8 - (i & 0x8);

// hMod: Allow the lever to change the current
// CanaryMod: Allow the lever to change the current
/*
* first 3 bits are for postion 4th bit is for power.(on / off)
*/
Expand Down
2 changes: 1 addition & 1 deletion src/OBlockPortal.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public boolean a_(OWorld paramOWorld, int paramInt1, int paramInt2, int paramInt
j = 1;
}

// Hmod: comment out debug message.
// CanaryMod: comment out debug message.
// System.out.println(i + ", " + j);
if (i == j) {
return false;
Expand Down
2 changes: 1 addition & 1 deletion src/OBlockPressurePlate.java
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ private void g(OWorld paramOWorld, int paramInt1, int paramInt2, int paramInt3)
j = 1;
}

// hMod: Allow pressure plate interaction to power redstone
// CanaryMod: Allow pressure plate interaction to power redstone
if (j != i) {
j = (Integer) etc.getLoader().callHook(PluginLoader.Hook.REDSTONE_CHANGE, new Block(bk, paramInt1, paramInt2, paramInt3), i, j);
if (j > 0)
Expand Down
6 changes: 3 additions & 3 deletions src/OBlockRedstoneTorch.java
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ public void a(OWorld paramOWorld, int paramInt1, int paramInt2, int paramInt3, R
if (bool) {
paramOWorld.b(paramInt1, paramInt2, paramInt3, OBlock.aP.bk, paramOWorld.b(paramInt1, paramInt2, paramInt3));

// hMod: Allow redstone torches to provide power
// CanaryMod: Allow redstone torches to provide power
int current = (Integer) etc.getLoader().callHook(PluginLoader.Hook.REDSTONE_CHANGE, new Object[] { new Block(bk, paramInt1, paramInt2, paramInt3), 1, 0 });
if (current == 0)
if (a(paramOWorld, paramInt1, paramInt2, paramInt3, true)) {
Expand All @@ -138,7 +138,7 @@ public void a(OWorld paramOWorld, int paramInt1, int paramInt2, int paramInt3, R
}
}
} else if ((!bool) && (!a(paramOWorld, paramInt1, paramInt2, paramInt3, false))) {
// hMod: Allow redstone torches to provide power
// CanaryMod: Allow redstone torches to provide power
int current = (Integer) etc.getLoader().callHook(PluginLoader.Hook.REDSTONE_CHANGE, new Object[] { new Block(bk, paramInt1, paramInt2, paramInt3), 0, 1 });
if (current > 0)
paramOWorld.b(paramInt1, paramInt2, paramInt3, OBlock.aQ.bk, paramOWorld.b(paramInt1, paramInt2, paramInt3));
Expand All @@ -154,7 +154,7 @@ public void a(OWorld paramOWorld, int paramInt1, int paramInt2, int paramInt3, i
@Override
public boolean c(OWorld paramOWorld, int paramInt1, int paramInt2, int paramInt3, int paramInt4) {
if (paramInt4 == 0) {
// hMod: forced downcast!
// CanaryMod: forced downcast!
return b((OIBlockAccess) paramOWorld, paramInt1, paramInt2, paramInt3, paramInt4);
}
return false;
Expand Down
2 changes: 1 addition & 1 deletion src/OBlockRedstoneWire.java
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ private void a(OWorld paramOWorld, int paramInt1, int paramInt2, int paramInt3,
j = 0;
}
}
// hMod: Allow redstone wire current changes
// CanaryMod: Allow redstone wire current changes
if (i != j)
j = (Integer) etc.getLoader().callHook(PluginLoader.Hook.REDSTONE_CHANGE, new Object[] { new Block(bk, paramInt1, paramInt2, paramInt3), i, j });

Expand Down
4 changes: 2 additions & 2 deletions src/OBlockSand.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ public OBlockSand(int paramInt1, int paramInt2) {

@Override
public void e(OWorld paramOWorld, int paramInt1, int paramInt2, int paramInt3) {
// hMod: Physics
// CanaryMod: Physics
if (!(Boolean) etc.getLoader().callHook(PluginLoader.Hook.BLOCK_PHYSICS, new Block(bk, paramInt1, paramInt2, paramInt3), true))
paramOWorld.c(paramInt1, paramInt2, paramInt3, bk, b());
}

@Override
public void a(OWorld paramOWorld, int paramInt1, int paramInt2, int paramInt3, int paramInt4) {
// hMod: Physics
// CanaryMod: Physics
if (!(Boolean) etc.getLoader().callHook(PluginLoader.Hook.BLOCK_PHYSICS, new Block(bk, paramInt1, paramInt2, paramInt3), true))
paramOWorld.c(paramInt1, paramInt2, paramInt3, bk, b());
}
Expand Down
2 changes: 1 addition & 1 deletion src/OBlockSapling.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public void b(OWorld paramOWorld, int paramInt1, int paramInt2, int paramInt3, R
paramOWorld.b(paramInt1, paramInt2, paramInt3, 0);
OWorldGenerator localObject = new OWorldGenTrees();

// hMod: generate more diverse trees
// CanaryMod: generate more diverse trees
int rnd = paramRandom.nextInt(11);
if (rnd == 0)
localObject = new OWorldGenBigTree();
Expand Down
2 changes: 1 addition & 1 deletion src/OBlockStationary.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ private void i(OWorld paramOWorld, int paramInt1, int paramInt2, int paramInt3)
public void a(OWorld paramOWorld, int paramInt1, int paramInt2, int paramInt3, Random paramRandom) {
if (bv == OMaterial.g) {
int i = paramRandom.nextInt(3);
// hMod: prevent lava from putting something on fire.
// CanaryMod: prevent lava from putting something on fire.
Block block = new Block(paramOWorld.a(paramInt1, paramInt2, paramInt3), paramInt1, paramInt2, paramInt3);
block.setStatus(1);
if (!(Boolean) etc.getLoader().callHook(PluginLoader.Hook.IGNITE, block, null))
Expand Down
4 changes: 2 additions & 2 deletions src/OChunkProviderServer.java
Original file line number Diff line number Diff line change
Expand Up @@ -140,11 +140,11 @@ public void a(OIChunkProvider paramOIChunkProvider, int paramInt1, int paramInt2
}
}

// hMod: load status
// CanaryMod: load status
boolean loaded = false;

public boolean a(boolean paramBoolean, OIProgressUpdate paramOIProgressUpdate) {
// hMod: load once!
// CanaryMod: load once!
if (!loaded) {
etc.getLoader().loadPlugins();
loaded = true;
Expand Down
2 changes: 1 addition & 1 deletion src/OConsoleLogManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public static void a() {
} catch (Exception localException) {
a.log(Level.WARNING, "Failed to log to server.log", localException);
}
// hMod: Keep the serveroutput logs.
// CanaryMod: Keep the serveroutput logs.
File log = new File("logs");
try {
if (!log.exists())
Expand Down
8 changes: 4 additions & 4 deletions src/OEntity.java
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,11 @@ public abstract class OEntity {
public int bC;
public int bD;

// hMod Start
// CanaryMod Start
BaseEntity entity = new BaseEntity(this);
public static PluginLoader manager = etc.getLoader();

// hMod end
// CanaryMod end

public OEntity(OWorld paramOWorld) {
aF = paramOWorld;
Expand Down Expand Up @@ -176,7 +176,7 @@ public void H() {
}
} else {
if (bt % 20 == 0) {
// hMod Damage hook: Periodic burn damage
// CanaryMod Damage hook: Periodic burn damage
if (!(Boolean) manager.callHook(PluginLoader.Hook.DAMAGE, PluginLoader.DamageType.FIRE_TICK, null, entity, 1))
a((OEntity) null, 1);
}
Expand All @@ -203,7 +203,7 @@ public void H() {

protected void P() {
if (!by) {
// hMod Damage hook: Lava
// CanaryMod Damage hook: Lava
if (this instanceof OEntityLiving)
if ((Boolean) manager.callHook(PluginLoader.Hook.DAMAGE, PluginLoader.DamageType.LAVA, null, entity, 4))
return;
Expand Down
14 changes: 7 additions & 7 deletions src/OEntityBoat.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ public class OEntityBoat extends OEntity {
private double h;
private double i;

// hMod Start
// CanaryMod Start
Boat boat = new Boat(this);

// hMod end
// CanaryMod end

public OEntityBoat(OWorld paramOWorld) {
super(paramOWorld);
Expand Down Expand Up @@ -53,7 +53,7 @@ public OEntityBoat(OWorld paramOWorld, double paramDouble1, double paramDouble2,
aH = paramDouble2;
aI = paramDouble3;

// hMod: Creation of the boat
// CanaryMod: Creation of the boat
manager.callHook(PluginLoader.Hook.VEHICLE_CREATE, boat);
}

Expand All @@ -64,7 +64,7 @@ public double k() {

@Override
public boolean a(OEntity paramOEntity, int paramInt) {
// hMod: Attack of the boat
// CanaryMod: Attack of the boat
if ((Boolean) manager.callHook(PluginLoader.Hook.VEHICLE_DAMAGE, boat, paramOEntity == null ? null : paramOEntity.entity, paramInt))
return true;

Expand Down Expand Up @@ -94,7 +94,7 @@ public boolean d_() {

@Override
public void f_() {
// hMod: Update of the boat
// CanaryMod: Update of the boat
manager.callHook(PluginLoader.Hook.VEHICLE_UPDATE, boat);

double prevX = this.aJ;
Expand Down Expand Up @@ -251,7 +251,7 @@ public void f_() {
aP = (float) (aP + d14);
c(aP, aQ);

// hMod: Change of the cart
// CanaryMod: Change of the cart
if(this.aJ != prevX || aK != prevY || aL != prevZ)
manager.callHook(PluginLoader.Hook.VEHICLE_POSITIONCHANGE, boat, (int)aJ, (int)aK, (int)aL);

Expand Down Expand Up @@ -290,7 +290,7 @@ protected void b(ONBTTagCompound paramONBTTagCompound) {

@Override
public boolean a(OEntityPlayer paramOEntityPlayer) {
// hMod: Entering the boat
// CanaryMod: Entering the boat
manager.callHook(PluginLoader.Hook.VEHICLE_ENTERED, boat, paramOEntityPlayer.entity);

if ((aD != null) && ((aD instanceof OEntityPlayer)) && (aD != paramOEntityPlayer)) {
Expand Down
2 changes: 1 addition & 1 deletion src/OEntityItem.java
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ public void b(OEntityPlayer paramOEntityPlayer) {

int i = a.a;
if ((c == 0) && (paramOEntityPlayer.i.a(a))) {
// hMod: allow item pickups
// CanaryMod: allow item pickups
Item item = new Item(a.c, i);
if (!(Boolean) etc.getLoader().callHook(PluginLoader.Hook.ITEM_PICK_UP, ((OEntityPlayerMP) paramOEntityPlayer).getPlayer(), item)) {
aF.a(this, "random.pop", 0.2F, ((bq.nextFloat() - bq.nextFloat()) * 0.7F + 1.0F) * 2.0F);
Expand Down
2 changes: 1 addition & 1 deletion src/OEntityList.java
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public static String b(OEntity paramOEntity) {
return (String) b.get(paramOEntity.getClass());
}

// hMod: Let us do a name->class lookup for mob spawning
// CanaryMod: Let us do a name->class lookup for mob spawning
public static Class<?> getEntity(String name) {
return a.get(name);
}
Expand Down
Loading

0 comments on commit 38e01ae

Please sign in to comment.