-
Notifications
You must be signed in to change notification settings - Fork 95
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
214 additions
and
73 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,6 +13,7 @@ | |
from mc import * | ||
import time | ||
import sys | ||
import os | ||
|
||
GRAVITIES = { | ||
'sun':274, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
src/main/java/mobi/omegacentauri/raspberryjammod/AddPythonExternalCommand.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package mobi.omegacentauri.raspberryjammod; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
import net.minecraft.command.CommandException; | ||
import net.minecraft.command.ICommand; | ||
import net.minecraft.command.ICommandSender; | ||
import net.minecraft.util.BlockPos; | ||
|
||
public class AddPythonExternalCommand extends PythonExternalCommand { | ||
|
||
public AddPythonExternalCommand() { | ||
super(); | ||
} | ||
|
||
@Override | ||
public String getName() { | ||
return "addpython"; | ||
} | ||
|
||
@Override | ||
public List getAliases() { | ||
List<String> aliases = new ArrayList<String>(); | ||
aliases.add(getName()); | ||
aliases.add("apy"); | ||
return aliases; | ||
} | ||
|
||
@Override | ||
public String getCommandUsage(ICommandSender sender) { | ||
return "addpython script arguments: run a new script without stopping old one(s)"; | ||
} | ||
|
||
@Override | ||
public boolean addMode() { | ||
return true; | ||
} | ||
} | ||
|
61 changes: 61 additions & 0 deletions
61
src/main/java/mobi/omegacentauri/raspberryjammod/ClientEventHandler.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
package mobi.omegacentauri.raspberryjammod; | ||
|
||
import java.beans.EventSetDescriptor; | ||
import java.util.ArrayList; | ||
import java.util.LinkedList; | ||
import java.util.List; | ||
|
||
import net.minecraft.block.Block; | ||
import net.minecraft.block.state.IBlockState; | ||
import net.minecraft.client.Minecraft; | ||
import net.minecraft.client.entity.EntityPlayerSP; | ||
import net.minecraft.client.gui.GuiChat; | ||
import net.minecraft.client.gui.GuiScreen; | ||
import net.minecraft.event.ClickEvent; | ||
import net.minecraft.item.ItemStack; | ||
import net.minecraft.item.ItemSword; | ||
import net.minecraft.nbt.NBTTagCompound; | ||
import net.minecraft.potion.Potion; | ||
import net.minecraft.potion.PotionEffect; | ||
import net.minecraft.server.MinecraftServer; | ||
import net.minecraft.tileentity.TileEntity; | ||
import net.minecraft.util.BlockPos; | ||
import net.minecraft.util.EnumFacing; | ||
import net.minecraft.util.IChatComponent; | ||
import net.minecraft.world.EnumDifficulty; | ||
import net.minecraft.world.World; | ||
import net.minecraftforge.client.event.MouseEvent; | ||
import net.minecraftforge.event.CommandEvent; | ||
import net.minecraftforge.event.ServerChatEvent; | ||
import net.minecraftforge.event.entity.player.PlayerInteractEvent; | ||
import net.minecraftforge.event.terraingen.InitMapGenEvent; | ||
import net.minecraftforge.fml.common.FMLCommonHandler; | ||
import net.minecraftforge.fml.common.eventhandler.Event; | ||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; | ||
import net.minecraftforge.fml.common.gameevent.InputEvent; | ||
import net.minecraftforge.fml.common.gameevent.TickEvent; | ||
import net.minecraftforge.fml.relauncher.Side; | ||
|
||
public class ClientEventHandler { | ||
private volatile boolean nightVision = false; | ||
private int clientTickCount = 0; | ||
|
||
@SubscribeEvent | ||
public void onClientTick(TickEvent.ClientTickEvent event) { | ||
if (nightVision && clientTickCount % 1024 == 0) { | ||
EntityPlayerSP player = Minecraft.getMinecraft().thePlayer; | ||
|
||
if (player != null) { | ||
player.addPotionEffect(new PotionEffect(Potion.nightVision.id, 4096)); | ||
} | ||
} | ||
clientTickCount++; | ||
} | ||
public void setNightVision(boolean b) { | ||
nightVision = b; | ||
} | ||
|
||
public boolean getNightVision() { | ||
return nightVision; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.