net.minecraft.client.multiplayer.PlayerControllerMP Java Examples

The following examples show how to use net.minecraft.client.multiplayer.PlayerControllerMP. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: MixinNetHandlerPlayClient.java    From LiquidBounce with GNU General Public License v3.0 6 votes vote down vote up
@Inject(method = "handleJoinGame", at = @At("HEAD"), cancellable = true)
private void handleJoinGameWithAntiForge(S01PacketJoinGame packetIn, final CallbackInfo callbackInfo) {
    if(!AntiForge.enabled || !AntiForge.blockFML || Minecraft.getMinecraft().isIntegratedServerRunning())
        return;

    PacketThreadUtil.checkThreadAndEnqueue(packetIn, (NetHandlerPlayClient) (Object) this, gameController);
    this.gameController.playerController = new PlayerControllerMP(gameController, (NetHandlerPlayClient) (Object) this);
    this.clientWorldController = new WorldClient((NetHandlerPlayClient) (Object) this, new WorldSettings(0L, packetIn.getGameType(), false, packetIn.isHardcoreMode(), packetIn.getWorldType()), packetIn.getDimension(), packetIn.getDifficulty(), this.gameController.mcProfiler);
    this.gameController.gameSettings.difficulty = packetIn.getDifficulty();
    this.gameController.loadWorld(this.clientWorldController);
    this.gameController.thePlayer.dimension = packetIn.getDimension();
    this.gameController.displayGuiScreen(new GuiDownloadTerrain((NetHandlerPlayClient) (Object) this));
    this.gameController.thePlayer.setEntityId(packetIn.getEntityId());
    this.currentServerMaxPlayers = packetIn.getMaxPlayers();
    this.gameController.thePlayer.setReducedDebug(packetIn.isReducedDebugInfo());
    this.gameController.playerController.setGameType(packetIn.getGameType());
    this.gameController.gameSettings.sendSettingsToServer();
    this.netManager.sendPacket(new C17PacketCustomPayload("MC|Brand", (new PacketBuffer(Unpooled.buffer())).writeString(ClientBrandRetriever.getClientModName())));
    callbackInfo.cancel();
}
 
Example #2
Source File: MixinNetHandlerPlayClient.java    From LiquidBounce with GNU General Public License v3.0 6 votes vote down vote up
@Inject(method = "handleJoinGame", at = @At("HEAD"), cancellable = true)
private void handleJoinGameWithAntiForge(S01PacketJoinGame packetIn, final CallbackInfo callbackInfo) {
    if(!AntiForge.enabled || !AntiForge.blockFML || Minecraft.getMinecraft().isIntegratedServerRunning())
        return;

    PacketThreadUtil.checkThreadAndEnqueue(packetIn, (NetHandlerPlayClient) (Object) this, gameController);
    this.gameController.playerController = new PlayerControllerMP(gameController, (NetHandlerPlayClient) (Object) this);
    this.clientWorldController = new WorldClient((NetHandlerPlayClient) (Object) this, new WorldSettings(0L, packetIn.getGameType(), false, packetIn.isHardcoreMode(), packetIn.getWorldType()), packetIn.getDimension(), packetIn.getDifficulty(), this.gameController.mcProfiler);
    this.gameController.gameSettings.difficulty = packetIn.getDifficulty();
    this.gameController.loadWorld(this.clientWorldController);
    this.gameController.thePlayer.dimension = packetIn.getDimension();
    this.gameController.displayGuiScreen(new GuiDownloadTerrain((NetHandlerPlayClient) (Object) this));
    this.gameController.thePlayer.setEntityId(packetIn.getEntityId());
    this.currentServerMaxPlayers = packetIn.getMaxPlayers();
    this.gameController.thePlayer.setReducedDebug(packetIn.isReducedDebugInfo());
    this.gameController.playerController.setGameType(packetIn.getGameType());
    this.gameController.gameSettings.sendSettingsToServer();
    this.netManager.sendPacket(new C17PacketCustomPayload("MC|Brand", (new PacketBuffer(Unpooled.buffer())).writeString(ClientBrandRetriever.getClientModName())));
    callbackInfo.cancel();
}
 
Example #3
Source File: PlayerControllerUtils.java    From ForgeWurst with GNU General Public License v3.0 5 votes vote down vote up
public static float getCurBlockDamageMP()
	throws ReflectiveOperationException
{
	Field field = PlayerControllerMP.class.getDeclaredField(
		wurst.isObfuscated() ? "field_78770_f" : "curBlockDamageMP");
	field.setAccessible(true);
	return field.getFloat(mc.playerController);
}
 
Example #4
Source File: PlayerControllerUtils.java    From ForgeWurst with GNU General Public License v3.0 5 votes vote down vote up
public static void setBlockHitDelay(int blockHitDelay)
	throws ReflectiveOperationException
{
	Field field = PlayerControllerMP.class.getDeclaredField(
		wurst.isObfuscated() ? "field_78781_i" : "blockHitDelay");
	field.setAccessible(true);
	field.setInt(mc.playerController, blockHitDelay);
}
 
Example #5
Source File: ForgeHaxHooks.java    From ForgeHax with MIT License 5 votes vote down vote up
public static void onPlayerAttackEntity(
  PlayerControllerMP playerControllerMP, EntityPlayer attacker, Entity victim) {
  if (HOOK_onPlayerAttackEntity.reportHook()) {
    MinecraftForge.EVENT_BUS.post(
      new PlayerAttackEntityEvent(playerControllerMP, attacker, victim));
  }
}
 
Example #6
Source File: PlayerSyncItemEvent.java    From ForgeHax with MIT License 4 votes vote down vote up
public PlayerSyncItemEvent(PlayerControllerMP playerController) {
  this.playerController = playerController;
}
 
Example #7
Source File: CraftingKeysClientProxy.java    From CraftingKeys with MIT License 4 votes vote down vote up
@Override
public void sendSlotClick(PlayerControllerMP controller, int windowId, int slot, int rightClick, int action,
                          EntityPlayer player) {

    controller.windowClick(windowId, slot, rightClick, ClickType.PICKUP, player);
}
 
Example #8
Source File: Helper.java    From ForgeHax with MIT License 4 votes vote down vote up
public static PlayerControllerMP getPlayerController() {
  return MC.playerController;
}
 
Example #9
Source File: ForgeHaxHooks.java    From ForgeHax with MIT License 4 votes vote down vote up
public static boolean onPlayerStopUse(
  PlayerControllerMP playerControllerMP, EntityPlayer player) {
  return HOOK_onPlayerStopUse.reportHook()
    && MinecraftForge.EVENT_BUS.post(new ItemStoppedUsedEvent(playerControllerMP, player));
}
 
Example #10
Source File: ForgeHaxHooks.java    From ForgeHax with MIT License 4 votes vote down vote up
public static void onPlayerBreakingBlock(
  PlayerControllerMP playerControllerMP, BlockPos pos, EnumFacing facing) {
  if (HOOK_onPlayerBreakingBlock.reportHook()) {
    MinecraftForge.EVENT_BUS.post(new PlayerDamageBlockEvent(playerControllerMP, pos, facing));
  }
}
 
Example #11
Source File: ForgeHaxHooks.java    From ForgeHax with MIT License 4 votes vote down vote up
public static void onPlayerItemSync(PlayerControllerMP playerControllerMP) {
  if (HOOK_onPlayerItemSync.reportHook()) {
    MinecraftForge.EVENT_BUS.post(new PlayerSyncItemEvent(playerControllerMP));
  }
}
 
Example #12
Source File: ItemStoppedUsedEvent.java    From ForgeHax with MIT License 4 votes vote down vote up
public PlayerControllerMP getPlayerController() {
  return playerController;
}
 
Example #13
Source File: ItemStoppedUsedEvent.java    From ForgeHax with MIT License 4 votes vote down vote up
public ItemStoppedUsedEvent(PlayerControllerMP playerController, EntityPlayer player) {
  this.playerController = playerController;
  this.player = player;
}
 
Example #14
Source File: PlayerSyncItemEvent.java    From ForgeHax with MIT License 4 votes vote down vote up
public PlayerControllerMP getPlayerController() {
  return playerController;
}
 
Example #15
Source File: PlayerAttackEntityEvent.java    From ForgeHax with MIT License 4 votes vote down vote up
public PlayerControllerMP getPlayerController() {
  return playerController;
}
 
Example #16
Source File: PlayerAttackEntityEvent.java    From ForgeHax with MIT License 4 votes vote down vote up
public PlayerAttackEntityEvent(
  PlayerControllerMP playerController, EntityPlayer attacker, Entity victim) {
  this.playerController = playerController;
  this.attacker = attacker;
  this.victim = victim;
}
 
Example #17
Source File: PlayerDamageBlockEvent.java    From ForgeHax with MIT License 4 votes vote down vote up
public PlayerControllerMP getPlayerController() {
  return playerController;
}
 
Example #18
Source File: PlayerDamageBlockEvent.java    From ForgeHax with MIT License 4 votes vote down vote up
public PlayerDamageBlockEvent(
  PlayerControllerMP playerController, BlockPos pos, EnumFacing side) {
  this.playerController = playerController;
  this.pos = pos;
  this.side = side;
}
 
Example #19
Source File: WrapperPlayerControllerMP.java    From ClientBase with MIT License 4 votes vote down vote up
public PlayerControllerMP unwrap() {
    return this.real;
}
 
Example #20
Source File: WrapperPlayerControllerMP.java    From ClientBase with MIT License 4 votes vote down vote up
public static void clickBlockCreative(WrapperMinecraft var0, WrapperPlayerControllerMP var1, WrapperBlockPos var2, WrapperEnumFacing var3) {
    PlayerControllerMP.clickBlockCreative(var0.unwrap(), var1.unwrap(), var2.unwrap(), var3.unwrap());
}
 
Example #21
Source File: WrapperPlayerControllerMP.java    From ClientBase with MIT License 4 votes vote down vote up
public WrapperPlayerControllerMP(PlayerControllerMP var1) {
    this.real = var1;
}
 
Example #22
Source File: CraftingKeysProxy.java    From CraftingKeys with MIT License 2 votes vote down vote up
/**
 * The Minecraft call to send a mouse click to a GUI. [Based on INVTW]
 *
 * @param controller The playerController (from Client)
 * @param windowId   The current Windows ID (from GUI)
 * @param slot       The slot to click on (slot index)
 * @param rightClick 1, if right click. Otherwise 0
 * @param action     0
 * @param player     The current player (from Client)
 */
@SideOnly(Side.CLIENT)
public void sendSlotClick(PlayerControllerMP controller, int windowId, int slot, int rightClick, @SuppressWarnings("SameParameterValue") int action,
                          EntityPlayer player) {

}