feat: remove experience
This commit is contained in:
1 parent
bdfe5350cd
commit
41d166afed
83 files changed
+47
-1501
No files matched your search
@@ -499,10 +499,6 @@ void ClientConnection::handleAddEntity(shared_ptr<AddEntityPacket> packet)
|
||||
e = shared_ptr<Entity>( new ThrownPotion(level, x, y, z, packet->data) );
|
||||
packet->data = 0;
|
||||
break;
|
||||
case AddEntityPacket::THROWN_EXPBOTTLE:
|
||||
e = shared_ptr<Entity>( new ThrownExpBottle(level, x, y, z) );
|
||||
packet->data = 0;
|
||||
break;
|
||||
case AddEntityPacket::BOAT:
|
||||
e = shared_ptr<Entity>( new Boat(level, x, y, z) );
|
||||
break;
|
||||
@@ -665,18 +661,6 @@ void ClientConnection::handleAddEntity(shared_ptr<AddEntityPacket> packet)
|
||||
|
||||
}
|
||||
|
||||
void ClientConnection::handleAddExperienceOrb(shared_ptr<AddExperienceOrbPacket> packet)
|
||||
{
|
||||
shared_ptr<Entity> e = shared_ptr<ExperienceOrb>( new ExperienceOrb(level, packet->x / 32.0, packet->y / 32.0, packet->z / 32.0, packet->value) );
|
||||
e->xp = packet->x;
|
||||
e->yp = packet->y;
|
||||
e->zp = packet->z;
|
||||
e->yRot = 0;
|
||||
e->xRot = 0;
|
||||
e->entityId = packet->id;
|
||||
level->putEntity(packet->id, e);
|
||||
}
|
||||
|
||||
void ClientConnection::handleAddGlobalEntity(shared_ptr<AddGlobalEntityPacket> packet)
|
||||
{
|
||||
double x = packet->x / 32.0;
|
||||
@@ -1234,18 +1218,7 @@ void ClientConnection::handleTakeItemEntity(shared_ptr<TakeItemEntityPacket> pac
|
||||
|
||||
if( minecraft->localgameModes[playerPad] != NULL )
|
||||
{
|
||||
// 4J-PB - add in the XP orb sound
|
||||
if(from->GetType() == eTYPE_EXPERIENCEORB)
|
||||
{
|
||||
float fPitch=((random->nextFloat() - random->nextFloat()) * 0.7f + 1.0f) * 2.0f;
|
||||
app.DebugPrintf("XP Orb with pitch %f\n",fPitch);
|
||||
level->playSound(from, eSoundType_RANDOM_ORB, 0.2f, fPitch);
|
||||
}
|
||||
else
|
||||
{
|
||||
level->playSound(from, eSoundType_RANDOM_POP, 0.2f, ((random->nextFloat() - random->nextFloat()) * 0.7f + 1.0f) * 2.0f);
|
||||
}
|
||||
|
||||
level->playSound(from, eSoundType_RANDOM_POP, 0.2f, ((random->nextFloat() - random->nextFloat()) * 0.7f + 1.0f) * 2.0f);
|
||||
minecraft->particleEngine->add( shared_ptr<TakeAnimationParticle>( new TakeAnimationParticle(minecraft->level, from, to, -0.5f) ) );
|
||||
level->removeEntity(packet->itemId);
|
||||
}
|
||||
@@ -2212,11 +2185,6 @@ void ClientConnection::handleSetHealth(shared_ptr<SetHealthPacket> packet)
|
||||
}
|
||||
}
|
||||
|
||||
void ClientConnection::handleSetExperience(shared_ptr<SetExperiencePacket> packet)
|
||||
{
|
||||
minecraft->localplayers[m_userIndex]->setExperienceValues(packet->experienceProgress, packet->totalExperience, packet->experienceLevel);
|
||||
}
|
||||
|
||||
void ClientConnection::handleTexture(shared_ptr<TexturePacket> packet)
|
||||
{
|
||||
// Both PlayerConnection and ClientConnection should handle this mostly the same way
|
||||
|
||||
@@ -51,7 +51,6 @@ public:
|
||||
INetworkPlayer *getNetworkPlayer();
|
||||
virtual void handleLogin(shared_ptr<LoginPacket> packet);
|
||||
virtual void handleAddEntity(shared_ptr<AddEntityPacket> packet);
|
||||
virtual void handleAddExperienceOrb(shared_ptr<AddExperienceOrbPacket> packet);
|
||||
virtual void handleAddGlobalEntity(shared_ptr<AddGlobalEntityPacket> packet);
|
||||
virtual void handleAddPainting(shared_ptr<AddPaintingPacket> packet);
|
||||
virtual void handleSetEntityMotion(shared_ptr<SetEntityMotionPacket> packet);
|
||||
@@ -93,7 +92,6 @@ private:
|
||||
wstring GetDisplayNameByGamertag(wstring gamertag);
|
||||
public:
|
||||
virtual void handleSetHealth(shared_ptr<SetHealthPacket> packet);
|
||||
virtual void handleSetExperience(shared_ptr<SetExperiencePacket> packet);
|
||||
virtual void handleRespawn(shared_ptr<RespawnPacket> packet);
|
||||
virtual void handleExplosion(shared_ptr<ExplodePacket> packet);
|
||||
virtual void handleContainerOpen(shared_ptr<ContainerOpenPacket> packet);
|
||||
|
||||
@@ -423,7 +423,6 @@ void IUIScene_CreativeMenu::staticCtor()
|
||||
|
||||
// Brewing (TODO)
|
||||
DEF(eCreativeInventory_Brewing)
|
||||
ITEM(Item::expBottle_Id)
|
||||
|
||||
// 4J Stu - Anything else added here also needs to be added to the key handler below
|
||||
ITEM(Item::ghastTear_Id)
|
||||
|
||||
@@ -84,40 +84,6 @@ void UIControl_EnchantmentButton::render(IggyCustomDrawCallbackRegion *region)
|
||||
//}
|
||||
|
||||
glColor4f(1, 1, 1, 1);
|
||||
if (cost != 0)
|
||||
{
|
||||
glEnable(GL_ALPHA_TEST);
|
||||
glAlphaFunc(GL_GREATER, 0.1f);
|
||||
Minecraft *pMinecraft = Minecraft::GetInstance();
|
||||
wstring line = _toString<int>(cost);
|
||||
Font *font = pMinecraft->altFont;
|
||||
//int col = 0x685E4A;
|
||||
unsigned int col = m_textColour;
|
||||
if (pMinecraft->localplayers[enchantingScene->getPad()]->experienceLevel < cost && !pMinecraft->localplayers[enchantingScene->getPad()]->abilities.instabuild)
|
||||
{
|
||||
col = m_textDisabledColour;
|
||||
font->drawWordWrap(m_enchantmentString, 0, 0, (float)m_width/ss, col, (float)m_height/ss);
|
||||
font = pMinecraft->font;
|
||||
//col = (0x80ff20 & 0xfefefe) >> 1;
|
||||
//font->drawShadow(line, (bwidth - font->width(line))/ss, 7, col);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (m_bHasFocus)
|
||||
{
|
||||
//col = 0xffff80;
|
||||
col = m_textFocusColour;
|
||||
}
|
||||
font->drawWordWrap(m_enchantmentString, 0, 0, (float)m_width/ss, col, (float)m_height/ss);
|
||||
font = pMinecraft->font;
|
||||
//col = 0x80ff20;
|
||||
//font->drawShadow(line, (bwidth - font->width(line))/ss, 7, col);
|
||||
}
|
||||
glDisable(GL_ALPHA_TEST);
|
||||
}
|
||||
else
|
||||
{
|
||||
}
|
||||
|
||||
//Lighting::turnOff();
|
||||
glDisable(GL_RESCALE_NORMAL);
|
||||
@@ -133,23 +99,6 @@ void UIControl_EnchantmentButton::updateState()
|
||||
int cost = menu->costs[m_index];
|
||||
|
||||
Minecraft *pMinecraft = Minecraft::GetInstance();
|
||||
if(cost > pMinecraft->localplayers[enchantingScene->getPad()]->experienceLevel && !pMinecraft->localplayers[enchantingScene->getPad()]->abilities.instabuild)
|
||||
{
|
||||
// Dark background
|
||||
state = eState_Inactive;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Light background and focus background
|
||||
if(m_bHasFocus)
|
||||
{
|
||||
state = eState_Selected;
|
||||
}
|
||||
else
|
||||
{
|
||||
state = eState_Active;
|
||||
}
|
||||
}
|
||||
|
||||
if(cost != m_lastCost)
|
||||
{
|
||||
|
||||
@@ -851,29 +851,6 @@ void UIScene_HUD::handleGameTick()
|
||||
#endif
|
||||
SetActiveSlot(pMinecraft->localplayers[m_iPad]->inventory->selected);
|
||||
|
||||
// Update xp progress
|
||||
if (pMinecraft->localgameModes[m_iPad]->canHurtPlayer())
|
||||
{
|
||||
ShowExpBar(true);
|
||||
int xpNeededForNextLevel = pMinecraft->localplayers[m_iPad]->getXpNeededForNextLevel();
|
||||
int progress = (int)(pMinecraft->localplayers[m_iPad]->experienceProgress *xpNeededForNextLevel);
|
||||
SetExpBarProgress((float)progress/xpNeededForNextLevel);
|
||||
}
|
||||
else
|
||||
{
|
||||
ShowExpBar(false);
|
||||
}
|
||||
|
||||
// Update xp level
|
||||
if (pMinecraft->localgameModes[m_iPad]->hasExperience() && pMinecraft->localplayers[m_iPad]->experienceLevel > 0)
|
||||
{
|
||||
SetExpLevel(pMinecraft->localplayers[m_iPad]->experienceLevel);
|
||||
}
|
||||
else
|
||||
{
|
||||
SetExpLevel(0);
|
||||
}
|
||||
|
||||
if (pMinecraft->localgameModes[m_iPad]->canHurtPlayer())
|
||||
{
|
||||
ShowHealth(true);
|
||||
|
||||
@@ -10,12 +10,12 @@ UIScene_HelpAndOptionsMenu::UIScene_HelpAndOptionsMenu(int iPad, void *initData,
|
||||
|
||||
m_bNotInGame=(Minecraft::GetInstance()->level==NULL);
|
||||
|
||||
m_buttons[BUTTON_HAO_CHANGESKIN].init(app.GetString(IDS_CHANGE_SKIN),BUTTON_HAO_CHANGESKIN);
|
||||
m_buttons[BUTTON_HAO_HOWTOPLAY].init(app.GetString(IDS_HOW_TO_PLAY),BUTTON_HAO_HOWTOPLAY);
|
||||
m_buttons[BUTTON_HAO_CONTROLS].init(app.GetString(IDS_CONTROLS),BUTTON_HAO_CONTROLS);
|
||||
m_buttons[BUTTON_HAO_SETTINGS].init(app.GetString(IDS_SETTINGS),BUTTON_HAO_SETTINGS);
|
||||
m_buttons[BUTTON_HAO_CREDITS].init(app.GetString(IDS_CREDITS),BUTTON_HAO_CREDITS);
|
||||
//m_buttons[BUTTON_HAO_REINSTALL].init(app.GetString(IDS_REINSTALL_CONTENT),BUTTON_HAO_REINSTALL);
|
||||
m_buttons[BUTTON_HAO_RESETTODEFAULTS].init(app.GetString(IDS_RESET_TO_DEFAULTS),BUTTON_HAO_RESETTODEFAULTS);
|
||||
m_buttons[BUTTON_HAO_DEBUG].init(app.GetString(IDS_DEBUG_SETTINGS),BUTTON_HAO_DEBUG);
|
||||
|
||||
/* 4J-TomK - we should never remove a control before the other buttons controls are initialised!
|
||||
@@ -70,11 +70,6 @@ UIScene_HelpAndOptionsMenu::UIScene_HelpAndOptionsMenu(int iPad, void *initData,
|
||||
}
|
||||
}
|
||||
|
||||
if(!ProfileManager.IsFullVersion() )//|| ProfileManager.IsGuest(m_iPad))
|
||||
{
|
||||
removeControl( &m_buttons[BUTTON_HAO_CHANGESKIN], false);
|
||||
}
|
||||
|
||||
//StorageManager.TMSPP_GetUserQuotaInfo(C4JStorage::eGlobalStorage_TitleUser,iPad);
|
||||
//StorageManager.WebServiceRequestGetFriends(iPad);
|
||||
}
|
||||
@@ -165,11 +160,6 @@ void UIScene_HelpAndOptionsMenu::handleReload()
|
||||
#endif
|
||||
}
|
||||
|
||||
if(!ProfileManager.IsFullVersion() )//|| ProfileManager.IsGuest(m_iPad))
|
||||
{
|
||||
removeControl( &m_buttons[BUTTON_HAO_CHANGESKIN], false);
|
||||
}
|
||||
|
||||
doHorizontalResizeCheck();
|
||||
}
|
||||
|
||||
@@ -208,9 +198,6 @@ void UIScene_HelpAndOptionsMenu::handlePress(F64 controlId, F64 childId)
|
||||
{
|
||||
switch((int)controlId)
|
||||
{
|
||||
case BUTTON_HAO_CHANGESKIN:
|
||||
ui.NavigateToScene(m_iPad, eUIScene_SkinSelectMenu);
|
||||
break;
|
||||
case BUTTON_HAO_HOWTOPLAY:
|
||||
ui.NavigateToScene(m_iPad, eUIScene_HowToPlayMenu);
|
||||
break;
|
||||
@@ -223,6 +210,15 @@ void UIScene_HelpAndOptionsMenu::handlePress(F64 controlId, F64 childId)
|
||||
case BUTTON_HAO_CREDITS:
|
||||
ui.NavigateToScene(m_iPad, eUIScene_Credits);
|
||||
break;
|
||||
case BUTTON_HAO_RESETTODEFAULTS:
|
||||
{
|
||||
UINT uiIDA[2];
|
||||
uiIDA[0]=IDS_CONFIRM_CANCEL;
|
||||
uiIDA[1]=IDS_CONFIRM_OK;
|
||||
|
||||
ui.RequestMessageBox(IDS_DEFAULTS_TITLE, IDS_DEFAULTS_TEXT, uiIDA, 2, m_iPad,&UIScene_HelpAndOptionsMenu::ResetDefaultsDialogReturned,this, app.GetStringTable(), NULL, 0, false);
|
||||
}
|
||||
break;
|
||||
case BUTTON_HAO_REINSTALL:
|
||||
ui.NavigateToScene(m_iPad, eUIScene_ReinstallMenu);
|
||||
break;
|
||||
@@ -231,3 +227,22 @@ void UIScene_HelpAndOptionsMenu::handlePress(F64 controlId, F64 childId)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
int UIScene_HelpAndOptionsMenu::ResetDefaultsDialogReturned(void *pParam,int iPad,C4JStorage::EMessageResult result)
|
||||
{
|
||||
UIScene_HelpAndOptionsMenu* pClass = (UIScene_HelpAndOptionsMenu*)pParam;
|
||||
|
||||
// results switched for this dialog
|
||||
if(result==C4JStorage::EMessage_ResultDecline)
|
||||
{
|
||||
#if (defined __PS3__ || defined __ORBIS__ || defined _DURANGO || defined __PSVITA__)
|
||||
app.SetDefaultOptions(StorageManager.GetDashboardProfileSettings(pClass->m_iPad),pClass->m_iPad);
|
||||
#else
|
||||
app.SetDefaultOptions(ProfileManager.GetDashboardProfileSettings(pClass->m_iPad),pClass->m_iPad);
|
||||
#endif
|
||||
// if the profile data has been changed, then force a profile write
|
||||
// It seems we're allowed to break the 5 minute rule if it's the result of a user action
|
||||
app.CheckGameSettingsChanged(true,iPad);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -2,12 +2,12 @@
|
||||
|
||||
#include "UIScene.h"
|
||||
|
||||
#define BUTTON_HAO_CHANGESKIN 0
|
||||
#define BUTTON_HAO_HOWTOPLAY 1
|
||||
#define BUTTON_HAO_CONTROLS 2
|
||||
#define BUTTON_HAO_SETTINGS 3
|
||||
#define BUTTON_HAO_CREDITS 4
|
||||
#define BUTTON_HAO_REINSTALL 5
|
||||
#define BUTTON_HAO_HOWTOPLAY 0
|
||||
#define BUTTON_HAO_CONTROLS 1
|
||||
#define BUTTON_HAO_SETTINGS 2
|
||||
#define BUTTON_HAO_CREDITS 3
|
||||
#define BUTTON_HAO_REINSTALL 4
|
||||
#define BUTTON_HAO_RESETTODEFAULTS 5
|
||||
#define BUTTON_HAO_DEBUG 6
|
||||
#define BUTTONS_HAO_MAX BUTTON_HAO_DEBUG + 1
|
||||
|
||||
@@ -16,12 +16,12 @@ class UIScene_HelpAndOptionsMenu : public UIScene
|
||||
private:
|
||||
UIControl_Button m_buttons[BUTTONS_HAO_MAX];
|
||||
UI_BEGIN_MAP_ELEMENTS_AND_NAMES(UIScene)
|
||||
UI_MAP_ELEMENT( m_buttons[BUTTON_HAO_CHANGESKIN], "Button1")
|
||||
UI_MAP_ELEMENT( m_buttons[BUTTON_HAO_HOWTOPLAY], "Button2")
|
||||
UI_MAP_ELEMENT( m_buttons[BUTTON_HAO_CONTROLS], "Button3")
|
||||
UI_MAP_ELEMENT( m_buttons[BUTTON_HAO_SETTINGS], "Button4")
|
||||
UI_MAP_ELEMENT( m_buttons[BUTTON_HAO_CREDITS], "Button5")
|
||||
UI_MAP_ELEMENT( m_buttons[BUTTON_HAO_REINSTALL], "Button6")
|
||||
UI_MAP_ELEMENT( m_buttons[BUTTON_HAO_HOWTOPLAY], "Button1")
|
||||
UI_MAP_ELEMENT( m_buttons[BUTTON_HAO_CONTROLS], "Button2")
|
||||
UI_MAP_ELEMENT( m_buttons[BUTTON_HAO_SETTINGS], "Button3")
|
||||
UI_MAP_ELEMENT( m_buttons[BUTTON_HAO_CREDITS], "Button4")
|
||||
UI_MAP_ELEMENT( m_buttons[BUTTON_HAO_REINSTALL], "Button5")
|
||||
UI_MAP_ELEMENT( m_buttons[BUTTON_HAO_RESETTODEFAULTS], "Button6")
|
||||
UI_MAP_ELEMENT( m_buttons[BUTTON_HAO_DEBUG], "Button7")
|
||||
UI_END_MAP_ELEMENTS_AND_NAMES()
|
||||
|
||||
@@ -47,4 +47,6 @@ public:
|
||||
|
||||
protected:
|
||||
void handlePress(F64 controlId, F64 childId);
|
||||
|
||||
static int ResetDefaultsDialogReturned(void *pParam,int iPad,C4JStorage::EMessageResult result);
|
||||
};
|
||||
@@ -56,22 +56,6 @@ HRESULT CXuiCtrlEnchantmentButton::OnGetSourceDataText(XUIMessageGetSourceText *
|
||||
|
||||
int cost = menu->costs[m_index];
|
||||
|
||||
if(cost != m_lastCost)
|
||||
{
|
||||
Minecraft *pMinecraft = Minecraft::GetInstance();
|
||||
if(cost > pMinecraft->localplayers[m_iPad]->experienceLevel && !pMinecraft->localplayers[m_iPad]->abilities.instabuild)
|
||||
{
|
||||
// Dark background
|
||||
SetEnable(FALSE);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Light background and focus background
|
||||
SetEnable(TRUE);
|
||||
}
|
||||
m_costString = _toString<int>(cost);
|
||||
m_lastCost = cost;
|
||||
}
|
||||
if(cost == 0)
|
||||
{
|
||||
// Dark background
|
||||
|
||||
@@ -122,36 +122,6 @@ HRESULT CXuiCtrlEnchantmentButtonText::OnRender(XUIMessageRender *pRenderData, B
|
||||
}
|
||||
|
||||
glColor4f(1, 1, 1, 1);
|
||||
if (cost != 0)
|
||||
{
|
||||
wstring line = _toString<int>(cost);
|
||||
Font *font = pMinecraft->altFont;
|
||||
//int col = 0x685E4A;
|
||||
unsigned int col = m_textColour;
|
||||
if (pMinecraft->localplayers[m_parentControl->m_iPad]->experienceLevel < cost && !pMinecraft->localplayers[m_parentControl->m_iPad]->abilities.instabuild)
|
||||
{
|
||||
col = m_textDisabledColour;
|
||||
font->drawWordWrap(m_enchantmentString, 0, 0, bwidth/ss, col, bheight/ss);
|
||||
font = pMinecraft->font;
|
||||
//col = (0x80ff20 & 0xfefefe) >> 1;
|
||||
//font->drawShadow(line, (bwidth - font->width(line))/ss, 7, col);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (m_parentControl->HasFocus())
|
||||
{
|
||||
//col = 0xffff80;
|
||||
col = m_textFocusColour;
|
||||
}
|
||||
font->drawWordWrap(m_enchantmentString, 0, 0, bwidth/ss, col, bheight/ss);
|
||||
font = pMinecraft->font;
|
||||
//col = 0x80ff20;
|
||||
//font->drawShadow(line, (bwidth - font->width(line))/ss, 7, col);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
}
|
||||
|
||||
//Lighting::turnOff();
|
||||
glDisable(GL_RESCALE_NORMAL);
|
||||
|
||||
@@ -141,36 +141,6 @@ HRESULT CXuiSceneHud::OnCustomMessage_TickScene()
|
||||
m_hotbarIcon[j]->SetAlpha( m_hotbarIcon[j]->m_hObj, opacity );
|
||||
}
|
||||
|
||||
// Update xp progress
|
||||
if (pMinecraft->localgameModes[m_iPad]->canHurtPlayer())
|
||||
{
|
||||
int xpNeededForNextLevel = pMinecraft->localplayers[m_iPad]->getXpNeededForNextLevel();
|
||||
int progress = (int)(pMinecraft->localplayers[m_iPad]->experienceProgress *xpNeededForNextLevel);
|
||||
|
||||
m_ExperienceProgress.SetShow(TRUE);
|
||||
m_ExperienceProgress.SetRange(0,xpNeededForNextLevel);
|
||||
m_ExperienceProgress.SetValue(progress);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_ExperienceProgress.SetShow(FALSE);
|
||||
}
|
||||
|
||||
// Update xp level
|
||||
if (pMinecraft->localgameModes[m_iPad]->hasExperience() && pMinecraft->localplayers[m_iPad]->experienceLevel > 0)
|
||||
{
|
||||
m_xpLevel.SetShow(TRUE);
|
||||
|
||||
wchar_t formatted[10];
|
||||
swprintf(formatted, 10, L"%d",pMinecraft->localplayers[m_iPad]->experienceLevel);
|
||||
|
||||
m_xpLevel.SetText(formatted);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_xpLevel.SetShow(FALSE);
|
||||
}
|
||||
|
||||
if (pMinecraft->localgameModes[m_iPad]->canHurtPlayer())
|
||||
{
|
||||
m_random.setSeed(m_tickCount * 312871);
|
||||
|
||||
@@ -16,7 +16,6 @@ protected:
|
||||
CXuiControl m_hudScaleGroup; // Contains all the HUD elements except crosshair
|
||||
CXuiControl m_hotbarGroup;
|
||||
CXuiCtrlSlotItem *m_hotbarIcon[9];
|
||||
CXuiProgressBar m_ExperienceProgress;
|
||||
CXuiControl m_healthGroup;
|
||||
CXuiControl m_healthIcon[10];
|
||||
CXuiControl m_armourGroup;
|
||||
@@ -25,7 +24,6 @@ protected:
|
||||
CXuiControl m_foodIcon[10];
|
||||
CXuiControl m_airGroup;
|
||||
CXuiControl m_airIcon[10];
|
||||
CXuiControl m_xpLevel;
|
||||
|
||||
D3DXVECTOR3 m_OriginalPosition;
|
||||
int m_iPad;
|
||||
@@ -58,7 +56,6 @@ protected:
|
||||
MAP_OVERRIDE(IDC_Inventory8, m_hotbarIcon[7])
|
||||
MAP_OVERRIDE(IDC_Inventory9, m_hotbarIcon[8])
|
||||
END_MAP_CHILD_CONTROLS()
|
||||
MAP_CONTROL(IDC_ExperienceProgress, m_ExperienceProgress)
|
||||
MAP_CONTROL(IDC_Health, m_healthGroup)
|
||||
BEGIN_MAP_CHILD_CONTROLS(m_healthGroup)
|
||||
MAP_CONTROL(IDC_Health0, m_healthIcon[0])
|
||||
@@ -111,7 +108,6 @@ protected:
|
||||
MAP_CONTROL(IDC_Air8, m_airIcon[8])
|
||||
MAP_CONTROL(IDC_Air9, m_airIcon[9])
|
||||
END_MAP_CHILD_CONTROLS()
|
||||
MAP_CONTROL(IDC_XPLevel, m_xpLevel)
|
||||
END_MAP_CHILD_CONTROLS()
|
||||
END_MAP_CHILD_CONTROLS()
|
||||
END_MAP_CHILD_CONTROLS()
|
||||
|
||||
@@ -41,7 +41,6 @@
|
||||
#include "HumanoidMobRenderer.h"
|
||||
#include "DefaultRenderer.h"
|
||||
#include "EndermanRenderer.h"
|
||||
#include "ExperienceOrbRenderer.h"
|
||||
#include "SilverfishRenderer.h"
|
||||
#include "MushroomCowRenderer.h"
|
||||
#include "SnowmanRenderer.h"
|
||||
@@ -123,12 +122,10 @@ EntityRenderDispatcher::EntityRenderDispatcher()
|
||||
renderers[eTYPE_EYEOFENDERSIGNAL] = new ItemSpriteRenderer(Item::eyeOfEnder);
|
||||
renderers[eTYPE_THROWNEGG] = new ItemSpriteRenderer(Item::egg);
|
||||
renderers[eTYPE_THROWNPOTION] = new ItemSpriteRenderer(Item::potion, PotionBrewing::THROWABLE_MASK);
|
||||
renderers[eTYPE_THROWNEXPBOTTLE] = new ItemSpriteRenderer(Item::expBottle);
|
||||
renderers[eTYPE_FIREBALL] = new FireballRenderer(2.0f);
|
||||
renderers[eTYPE_SMALL_FIREBALL] = new FireballRenderer(0.5f);
|
||||
renderers[eTYPE_DRAGON_FIREBALL] = new FireballRenderer(2.0f); // 4J Added TU9
|
||||
renderers[eTYPE_ITEMENTITY] = new ItemRenderer();
|
||||
renderers[eTYPE_EXPERIENCEORB] = new ExperienceOrbRenderer();
|
||||
renderers[eTYPE_PRIMEDTNT] = new TntRenderer();
|
||||
renderers[eTYPE_FALLINGTILE] = new FallingTileRenderer();
|
||||
renderers[eTYPE_MINECART] = new MinecartRenderer();
|
||||
|
||||
@@ -50,7 +50,6 @@ void EntityTracker::addEntity(shared_ptr<Entity> e)
|
||||
else if (e->GetType() == eTYPE_EYEOFENDERSIGNAL ) addEntity(e, 16 * 4, 4, true);
|
||||
else if (e->GetType() == eTYPE_THROWNEGG) addEntity(e, 16 * 4, 10, true);
|
||||
else if (e->GetType() == eTYPE_THROWNPOTION ) addEntity(e, 16 * 4, 10, true);
|
||||
else if (e->GetType() == eTYPE_THROWNEXPBOTTLE) addEntity(e, 16 * 4, 10, true);
|
||||
else if (e->GetType() == eTYPE_ITEMENTITY) addEntity(e, 16 * 4, 20, true);
|
||||
else if (e->GetType() == eTYPE_MINECART) addEntity(e, 16 * 5, 3, true);
|
||||
else if (e->GetType() == eTYPE_BOAT) addEntity(e, 16 * 5, 3, true);
|
||||
@@ -60,7 +59,6 @@ void EntityTracker::addEntity(shared_ptr<Entity> e)
|
||||
else if (e->GetType() == eTYPE_PRIMEDTNT) addEntity(e, 16 * 10, 10, true);
|
||||
else if (e->GetType() == eTYPE_FALLINGTILE) addEntity(e, 16 * 10, 20, true);
|
||||
else if (e->GetType() == eTYPE_PAINTING) addEntity(e, 16 * 10, INT_MAX, false);
|
||||
else if (e->GetType() == eTYPE_EXPERIENCEORB) addEntity(e, 16 * 10, 20, true);
|
||||
else if (e->GetType() == eTYPE_ENDER_CRYSTAL) addEntity(e, 16 * 16, INT_MAX, false);
|
||||
else if (e->GetType() == eTYPE_ITEM_FRAME) addEntity(e, 16 * 10, INT_MAX, false);
|
||||
}
|
||||
|
||||
@@ -1,91 +0,0 @@
|
||||
#include "stdafx.h"
|
||||
#include "ExperienceOrbRenderer.h"
|
||||
#include "..\Minecraft.World\net.minecraft.world.entity.h"
|
||||
#include "..\Minecraft.World\net.minecraft.world.level.tile.h"
|
||||
#include "..\Minecraft.World\net.minecraft.world.item.h"
|
||||
#include "Tesselator.h"
|
||||
#include "EntityRenderDispatcher.h"
|
||||
#include "..\Minecraft.World\Mth.h"
|
||||
#include "..\Minecraft.World\JavaMath.h"
|
||||
|
||||
ExperienceOrbRenderer::ExperienceOrbRenderer()
|
||||
{
|
||||
// 4J In class Java initialisors
|
||||
tileRenderer = new TileRenderer();
|
||||
setColor = true;
|
||||
|
||||
this->shadowRadius = 0.15f;
|
||||
this->shadowStrength = 0.75f;
|
||||
}
|
||||
|
||||
|
||||
void ExperienceOrbRenderer::render(shared_ptr<Entity> _orb, double x, double y, double z, float rot, float a)
|
||||
{
|
||||
shared_ptr<ExperienceOrb> orb = dynamic_pointer_cast<ExperienceOrb>(_orb);
|
||||
glPushMatrix();
|
||||
glTranslatef((float) x, (float) y, (float) z);
|
||||
|
||||
int icon = orb->getIcon();
|
||||
bindTexture(TN_ITEM_EXPERIENCE_ORB); // 4J was L"/item/xporb.png"
|
||||
Tesselator *t = Tesselator::getInstance();
|
||||
|
||||
float u0 = ((icon % 4) * 16 + 0) / 64.0f;
|
||||
float u1 = ((icon % 4) * 16 + 16) / 64.0f;
|
||||
float v0 = ((icon / 4) * 16 + 0) / 64.0f;
|
||||
float v1 = ((icon / 4) * 16 + 16) / 64.0f;
|
||||
|
||||
|
||||
float r = 1.0f;
|
||||
float xo = 0.5f;
|
||||
float yo = 0.25f;
|
||||
|
||||
if (SharedConstants::TEXTURE_LIGHTING)
|
||||
{
|
||||
int col = orb->getLightColor(a);
|
||||
int u = col % 65536;
|
||||
int v = col / 65536;
|
||||
glMultiTexCoord2f(GL_TEXTURE1, u / 1.0f, v / 1.0f);
|
||||
glColor4f(1, 1, 1, 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
float br = orb->getBrightness(a);
|
||||
glColor4f(br, br, br, 1);
|
||||
}
|
||||
float br = 255.0f;
|
||||
float rr = (orb->tickCount + a) / 2;
|
||||
int rc = (int) ((Mth::sin(rr + 0 * PI * 2 / 3) + 1) * 0.5f * br);
|
||||
int gc = (int) (br);
|
||||
int bc = (int) ((Mth::sin(rr + 2 * PI * 2 / 3) + 1) * 0.1f * br);
|
||||
int col = rc << 16 | gc << 8 | bc;
|
||||
glRotatef(180 - entityRenderDispatcher->playerRotY, 0, 1, 0);
|
||||
glRotatef(-entityRenderDispatcher->playerRotX, 1, 0, 0);
|
||||
float s = 0.3f;
|
||||
glScalef(s, s, s);
|
||||
t->begin();
|
||||
t->color(col, 128);
|
||||
t->normal(0, 1, 0);
|
||||
t->vertexUV(0 - xo, 0 - yo, 0, u0, v1);
|
||||
t->vertexUV(r - xo, 0 - yo, 0, u1, v1);
|
||||
t->vertexUV(r - xo, 1 - yo, 0, u1, v0);
|
||||
t->vertexUV(0 - xo, 1 - yo, 0, u0, v0);
|
||||
t->end();
|
||||
|
||||
glDisable(GL_BLEND);
|
||||
glDisable(GL_RESCALE_NORMAL);
|
||||
glPopMatrix();
|
||||
}
|
||||
|
||||
void ExperienceOrbRenderer::blit(int x, int y, int sx, int sy, int w, int h)
|
||||
{
|
||||
float blitOffset = 0;
|
||||
float us = 1 / 256.0f;
|
||||
float vs = 1 / 256.0f;
|
||||
Tesselator *t = Tesselator::getInstance();
|
||||
t->begin();
|
||||
t->vertexUV(x + 0, y + h, blitOffset, (sx + 0) * us, (sy + h) * vs);
|
||||
t->vertexUV(x + w, y + h, blitOffset, (sx + w) * us, (sy + h) * vs);
|
||||
t->vertexUV(x + w, y + 0, blitOffset, (sx + w) * us, (sy + 0) * vs);
|
||||
t->vertexUV(x + 0, y + 0, blitOffset, (sx + 0) * us, (sy + 0) * vs);
|
||||
t->end();
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include "EntityRenderer.h"
|
||||
|
||||
class ExperienceOrbRenderer : public EntityRenderer
|
||||
{
|
||||
private:
|
||||
TileRenderer *tileRenderer;
|
||||
|
||||
public:
|
||||
bool setColor;
|
||||
|
||||
ExperienceOrbRenderer();
|
||||
|
||||
void render(shared_ptr<Entity> _orb, double x, double y, double z, float rot, float a);
|
||||
void blit(int x, int y, int sx, int sy, int w, int h);
|
||||
};
|
||||
@@ -41,7 +41,6 @@ public:
|
||||
|
||||
virtual bool isCutScene();
|
||||
virtual void releaseUsingItem(shared_ptr<Player> player);
|
||||
virtual bool hasExperience();
|
||||
virtual bool hasMissTime();
|
||||
virtual bool hasInfiniteItems();
|
||||
virtual bool hasFarPickRange();
|
||||
|
||||
@@ -618,48 +618,6 @@ void Gui::render(float a, bool mouseFree, int xMouse, int yMouse)
|
||||
}
|
||||
}
|
||||
|
||||
#if RENDER_HUD
|
||||
// Moved so the opacity blend is applied to it
|
||||
if (bDisplayGui && minecraft->gameMode->hasExperience() && minecraft->player->experienceLevel > 0)
|
||||
{
|
||||
if (true)
|
||||
{
|
||||
bool blink = false;
|
||||
int col = blink ? 0xffffff : 0x80ff20;
|
||||
wchar_t formatted[10];
|
||||
swprintf(formatted, 10, L"%d",minecraft->player->experienceLevel);
|
||||
|
||||
wstring str = formatted;
|
||||
int x = iWidthOffset + (screenWidth - font->width(str)) / 2;
|
||||
int y = screenHeight - iSafezoneYHalf - iTooltipsYOffset;
|
||||
// If we're in creative mode, we don't need to offset the XP display so much
|
||||
if (minecraft->gameMode->canHurtPlayer())
|
||||
{
|
||||
y-=18;
|
||||
}
|
||||
else
|
||||
{
|
||||
y-=13;
|
||||
}
|
||||
|
||||
if(bTwoPlayerSplitscreen)
|
||||
{
|
||||
y+=iHeightOffset;
|
||||
}
|
||||
//int y = screenHeight - 31 - 4;
|
||||
font->draw(str, x + 1, y, 0x000000);
|
||||
font->draw(str, x - 1, y, 0x000000);
|
||||
font->draw(str, x, y + 1, 0x000000);
|
||||
font->draw(str, x, y - 1, 0x000000);
|
||||
// font->draw(str, x + 1, y + 1, 0x000000);
|
||||
// font->draw(str, x - 1, y + 1, 0x000000);
|
||||
// font->draw(str, x + 1, y - 1, 0x000000);
|
||||
// font->draw(str, x - 1, y - 1, 0x000000);
|
||||
font->draw(str, x, y, col);
|
||||
}
|
||||
}
|
||||
#endif // RENDER_HUD
|
||||
|
||||
// 4J - added to disable blends, which we have enabled previously to allow gui fading
|
||||
glDisable(GL_BLEND);
|
||||
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||
@@ -719,46 +677,8 @@ void Gui::render(float a, bool mouseFree, int xMouse, int yMouse)
|
||||
font->drawShadow(minecraft->gatherStats3(), iSafezoneXHalf+2, 32 + 30, 0xffffff);
|
||||
font->drawShadow(minecraft->gatherStats4(), iSafezoneXHalf+2, 32 + 40, 0xffffff);
|
||||
|
||||
// TERRAIN FEATURES
|
||||
int iYPos=82;
|
||||
|
||||
if(minecraft->level->dimension->id==0)
|
||||
{
|
||||
wstring wfeature[eTerrainFeature_Count];
|
||||
|
||||
wfeature[eTerrainFeature_Stronghold] = L"Stronghold: ";
|
||||
wfeature[eTerrainFeature_Mineshaft] = L"Mineshaft: ";
|
||||
wfeature[eTerrainFeature_Village] = L"Village: ";
|
||||
wfeature[eTerrainFeature_Ravine] = L"Ravine: ";
|
||||
|
||||
for(int i=0;i<app.m_vTerrainFeatures.size();i++)
|
||||
{
|
||||
FEATURE_DATA *pFeatureData=app.m_vTerrainFeatures[i];
|
||||
|
||||
wstring itemInfo = L"[" + _toString<int>( pFeatureData->x*16 ) + L", " + _toString<int>( pFeatureData->z*16 ) + L"] ";
|
||||
wfeature[pFeatureData->eTerrainFeature] += itemInfo;
|
||||
}
|
||||
|
||||
for( int i = eTerrainFeature_Stronghold; i < (int) eTerrainFeature_Count; i++ )
|
||||
{
|
||||
font->drawShadow(wfeature[i], iSafezoneXHalf + 2, iYPos, 0xffffff);
|
||||
iYPos+=10;
|
||||
}
|
||||
}
|
||||
|
||||
//font->drawShadow(minecraft->gatherStats5(), iSafezoneXHalf+2, 32 + 10, 0xffffff);
|
||||
{
|
||||
/* 4J - removed
|
||||
long max = Runtime.getRuntime().maxMemory();
|
||||
long total = Runtime.getRuntime().totalMemory();
|
||||
long free = Runtime.getRuntime().freeMemory();
|
||||
long used = total - free;
|
||||
String msg = "Used memory: " + (used * 100 / max) + "% (" + (used / 1024 / 1024) + "MB) of " + (max / 1024 / 1024) + "MB";
|
||||
drawString(font, msg, screenWidth - font.width(msg) - 2, 2, 0xe0e0e0);
|
||||
msg = "Allocated memory: " + (total * 100 / max) + "% (" + (total / 1024 / 1024) + "MB)";
|
||||
drawString(font, msg, screenWidth - font.width(msg) - 2, 12, 0xe0e0e0);
|
||||
*/
|
||||
}
|
||||
// 4J Stu - Moved these so that they don't overlap
|
||||
double xBlockPos = floor(minecraft->player->x);
|
||||
double yBlockPos = floor(minecraft->player->y);
|
||||
|
||||
@@ -1044,13 +1044,6 @@ bool LocalPlayer::checkInTile(double x, double y, double z)
|
||||
|
||||
}
|
||||
|
||||
void LocalPlayer::setExperienceValues(float experienceProgress, int totalExp, int experienceLevel)
|
||||
{
|
||||
this->experienceProgress = experienceProgress;
|
||||
this->totalExperience = totalExp;
|
||||
this->experienceLevel = experienceLevel;
|
||||
}
|
||||
|
||||
bool LocalPlayer::hasPermission(EGameCommand command)
|
||||
{
|
||||
return level->getLevelData()->getAllowCommands();
|
||||
|
||||
@@ -171,8 +171,6 @@ protected:
|
||||
bool checkInTile(double x, double y, double z);
|
||||
|
||||
public:
|
||||
void setExperienceValues(float experienceProgress, int totalExp, int experienceLevel);
|
||||
|
||||
bool hasPermission(EGameCommand command);
|
||||
|
||||
void updateRichPresence();
|
||||
|
||||
@@ -8043,7 +8043,6 @@ xcopy /q /y /i /s /e $(ProjectDir)Durango\CU $(LayoutDir)Image\Loose\CU</Comman
|
||||
<ClInclude Include="EntityTileRenderer.h" />
|
||||
<ClInclude Include="EntityTracker.h" />
|
||||
<ClInclude Include="ErrorScreen.h" />
|
||||
<ClInclude Include="ExperienceOrbRenderer.h" />
|
||||
<ClInclude Include="ExplodeParticle.h" />
|
||||
<ClInclude Include="extraX64client.h" />
|
||||
<ClInclude Include="FallingTileRenderer.h" />
|
||||
@@ -25398,7 +25397,6 @@ xcopy /q /y /i /s /e $(ProjectDir)Durango\CU $(LayoutDir)Image\Loose\CU</Comman
|
||||
<ClCompile Include="EntityTileRenderer.cpp" />
|
||||
<ClCompile Include="EntityTracker.cpp" />
|
||||
<ClCompile Include="ErrorScreen.cpp" />
|
||||
<ClCompile Include="ExperienceOrbRenderer.cpp" />
|
||||
<ClCompile Include="ExplodeParticle.cpp" />
|
||||
<ClCompile Include="Extrax64Stubs.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Xbox 360'">true</ExcludedFromBuild>
|
||||
|
||||
@@ -1756,9 +1756,6 @@
|
||||
<ClInclude Include="EndermanRenderer.h">
|
||||
<Filter>net\minecraft\client\renderer\entity</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="ExperienceOrbRenderer.h">
|
||||
<Filter>net\minecraft\client\renderer\entity</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="SilverfishRenderer.h">
|
||||
<Filter>net\minecraft\client\renderer\entity</Filter>
|
||||
</ClInclude>
|
||||
@@ -4359,9 +4356,6 @@
|
||||
<ClCompile Include="EndermanRenderer.cpp">
|
||||
<Filter>net\minecraft\client\renderer\entity</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="ExperienceOrbRenderer.cpp">
|
||||
<Filter>net\minecraft\client\renderer\entity</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="SilverfishRenderer.cpp">
|
||||
<Filter>net\minecraft\client\renderer\entity</Filter>
|
||||
</ClCompile>
|
||||
|
||||
@@ -2436,10 +2436,6 @@ void Minecraft::tick(bool bFirst, bool bUpdateTextures)
|
||||
*piUse=IDS_TOOLTIPS_THROW;
|
||||
}
|
||||
break;
|
||||
|
||||
case Item::expBottle_Id:
|
||||
if (bUseItem) *piUse=IDS_TOOLTIPS_THROW;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -442,11 +442,6 @@ void MultiPlayerGameMode::releaseUsingItem(shared_ptr<Player> player)
|
||||
player->releaseUsingItem();
|
||||
}
|
||||
|
||||
bool MultiPlayerGameMode::hasExperience()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
bool MultiPlayerGameMode::hasMissTime()
|
||||
{
|
||||
return !localPlayerMode->isCreative();
|
||||
|
||||
@@ -51,7 +51,6 @@ public:
|
||||
virtual void handleCreativeModeItemAdd(shared_ptr<ItemInstance> clicked, int slot);
|
||||
virtual void handleCreativeModeItemDrop(shared_ptr<ItemInstance> clicked);
|
||||
virtual void releaseUsingItem(shared_ptr<Player> player);
|
||||
virtual bool hasExperience();
|
||||
virtual bool hasMissTime();
|
||||
virtual bool hasInfiniteItems();
|
||||
virtual bool hasFarPickRange();
|
||||
|
||||
@@ -484,7 +484,6 @@ void PreStitchedTextureMap::loadUVs()
|
||||
texturesByName.insert(stringIconMap::value_type(L"minecartFurnace",new SimpleIcon(L"minecartFurnace",slotSize*7,slotSize*10,slotSize*(7+1),slotSize*(10+1))));
|
||||
texturesByName.insert(stringIconMap::value_type(L"monsterPlacer_overlay",new SimpleIcon(L"monsterPlacer_overlay",slotSize*9,slotSize*10,slotSize*(9+1),slotSize*(10+1))));
|
||||
texturesByName.insert(stringIconMap::value_type(L"ruby",new SimpleIcon(L"ruby",slotSize*10,slotSize*10,slotSize*(10+1),slotSize*(10+1))));
|
||||
texturesByName.insert(stringIconMap::value_type(L"expBottle",new SimpleIcon(L"expBottle",slotSize*11,slotSize*10,slotSize*(11+1),slotSize*(10+1))));
|
||||
texturesByName.insert(stringIconMap::value_type(L"brewingStand",new SimpleIcon(L"brewingStand",slotSize*12,slotSize*10,slotSize*(12+1),slotSize*(10+1))));
|
||||
texturesByName.insert(stringIconMap::value_type(L"magmaCream",new SimpleIcon(L"magmaCream",slotSize*13,slotSize*10,slotSize*(13+1),slotSize*(10+1))));
|
||||
texturesByName.insert(stringIconMap::value_type(L"dyePowder_cyan",new SimpleIcon(L"dyePowder_cyan",slotSize*14,slotSize*10,slotSize*(14+1),slotSize*(10+1))));
|
||||
|
||||
@@ -14,7 +14,6 @@ ServerCommandDispatcher::ServerCommandDispatcher()
|
||||
addCommand(new DefaultGameModeCommand());
|
||||
addCommand(new KillCommand());
|
||||
addCommand(new ToggleDownfallCommand());
|
||||
addCommand(new ExperienceCommand());
|
||||
addCommand(new TeleportCommand());
|
||||
addCommand(new GiveItemCommand());
|
||||
addCommand(new EnchantItemCommand());
|
||||
|
||||
@@ -1228,18 +1228,6 @@ bool ServerLevel::addEntity(shared_ptr<Entity> e)
|
||||
}
|
||||
LeaveCriticalSection(&m_limiterCS);
|
||||
}
|
||||
// If its an experience orb entity, and we've got to our capacity, delete the oldest
|
||||
else if( dynamic_pointer_cast<ExperienceOrb>(e) != NULL )
|
||||
{
|
||||
// printf("Adding arrow entity count %d\n",m_arrowEntities.size());
|
||||
EnterCriticalSection(&m_limiterCS);
|
||||
if( m_experienceOrbEntities.size() >= MAX_EXPERIENCEORB_ENTITIES )
|
||||
{
|
||||
// printf("Adding - doing remove\n");
|
||||
removeEntityImmediately(m_experienceOrbEntities.front());
|
||||
}
|
||||
LeaveCriticalSection(&m_limiterCS);
|
||||
}
|
||||
return Level::addEntity(e);
|
||||
}
|
||||
|
||||
@@ -1267,13 +1255,6 @@ void ServerLevel::entityAddedExtra(shared_ptr<Entity> e)
|
||||
// printf("entity added: arrow entity count now %d\n",m_arrowEntities.size());
|
||||
LeaveCriticalSection(&m_limiterCS);
|
||||
}
|
||||
else if( dynamic_pointer_cast<ExperienceOrb>(e) != NULL )
|
||||
{
|
||||
EnterCriticalSection(&m_limiterCS);
|
||||
m_experienceOrbEntities.push_back(e);
|
||||
// printf("entity added: experience orb entity count now %d\n",m_arrowEntities.size());
|
||||
LeaveCriticalSection(&m_limiterCS);
|
||||
}
|
||||
else if( dynamic_pointer_cast<PrimedTnt>(e) != NULL )
|
||||
{
|
||||
EnterCriticalSection(&m_limiterCS);
|
||||
@@ -1330,19 +1311,6 @@ void ServerLevel::entityRemovedExtra(shared_ptr<Entity> e)
|
||||
// printf("entity removed: arrow entity count now %d\n",m_arrowEntities.size());
|
||||
LeaveCriticalSection(&m_limiterCS);
|
||||
}
|
||||
else if( dynamic_pointer_cast<ExperienceOrb>(e) != NULL )
|
||||
{
|
||||
EnterCriticalSection(&m_limiterCS);
|
||||
// printf("entity removed: experience orb entity count %d\n",m_arrowEntities.size());
|
||||
AUTO_VAR(it, find(m_experienceOrbEntities.begin(),m_experienceOrbEntities.end(),e));
|
||||
if( it != m_experienceOrbEntities.end() )
|
||||
{
|
||||
// printf("Item to remove found\n");
|
||||
m_experienceOrbEntities.erase(it);
|
||||
}
|
||||
// printf("entity removed: experience orb entity count now %d\n",m_arrowEntities.size());
|
||||
LeaveCriticalSection(&m_limiterCS);
|
||||
}
|
||||
else if( dynamic_pointer_cast<PrimedTnt>(e) != NULL )
|
||||
{
|
||||
EnterCriticalSection(&m_limiterCS);
|
||||
|
||||
@@ -127,7 +127,6 @@ public:
|
||||
static const int MAX_HANGING_ENTITIES = 400;
|
||||
static const int MAX_ITEM_ENTITIES = 200;
|
||||
static const int MAX_ARROW_ENTITIES = 200;
|
||||
static const int MAX_EXPERIENCEORB_ENTITIES = 50;
|
||||
static const int MAX_PRIMED_TNT = 20;
|
||||
static const int MAX_FALLING_TILE = 20;
|
||||
|
||||
@@ -137,7 +136,6 @@ public:
|
||||
list< shared_ptr<Entity> > m_itemEntities;
|
||||
list< shared_ptr<Entity> > m_hangingEntities;
|
||||
list< shared_ptr<Entity> > m_arrowEntities;
|
||||
list< shared_ptr<Entity> > m_experienceOrbEntities;
|
||||
|
||||
virtual bool addEntity(shared_ptr<Entity> e);
|
||||
void entityAddedExtra(shared_ptr<Entity> e);
|
||||
|
||||
@@ -190,12 +190,6 @@ void ServerPlayer::addAdditonalSaveData(CompoundTag *entityTag)
|
||||
//entityTag->putInt(L"playerGameType", gameMode->getGameModeForPlayer()->getId());
|
||||
}
|
||||
|
||||
void ServerPlayer::withdrawExperienceLevels(int amount)
|
||||
{
|
||||
Player::withdrawExperienceLevels(amount);
|
||||
lastSentExp = -1;
|
||||
}
|
||||
|
||||
void ServerPlayer::initMenu()
|
||||
{
|
||||
containerMenu->addSlotListener(this);
|
||||
@@ -546,13 +540,6 @@ void ServerPlayer::doTickB(bool ignorePortal)
|
||||
lastSentFood = foodData.getFoodLevel();
|
||||
lastFoodSaturationZero = foodData.getSaturationLevel() == 0;
|
||||
}
|
||||
|
||||
if (totalExperience != lastSentExp)
|
||||
{
|
||||
lastSentExp = totalExperience;
|
||||
connection->send( shared_ptr<SetExperiencePacket>( new SetExperiencePacket(experienceProgress, totalExperience, experienceLevel) ) );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
shared_ptr<ItemInstance> ServerPlayer::getCarried(int slot)
|
||||
@@ -760,10 +747,6 @@ void ServerPlayer::take(shared_ptr<Entity> e, int orgCount)
|
||||
{
|
||||
entityTracker->broadcast(e, shared_ptr<TakeItemEntityPacket>( new TakeItemEntityPacket(e->entityId, entityId) ) );
|
||||
}
|
||||
if (e->GetType() == eTYPE_EXPERIENCEORB)
|
||||
{
|
||||
entityTracker->broadcast(e, shared_ptr<TakeItemEntityPacket>( new TakeItemEntityPacket(e->entityId, entityId) ) );
|
||||
}
|
||||
}
|
||||
Player::take(e, orgCount);
|
||||
containerMenu->broadcastChanges();
|
||||
|
||||
@@ -45,7 +45,6 @@ public:
|
||||
|
||||
virtual void readAdditionalSaveData(CompoundTag *entityTag);
|
||||
virtual void addAdditonalSaveData(CompoundTag *entityTag);
|
||||
virtual void withdrawExperienceLevels(int amount);
|
||||
void initMenu();
|
||||
|
||||
private:
|
||||
|
||||
@@ -28,5 +28,4 @@ public:
|
||||
virtual shared_ptr<Player> createPlayer(Level *level);
|
||||
virtual void tick();
|
||||
virtual bool useItemOn(shared_ptr<Player> player, Level *level, shared_ptr<ItemInstance> item, int x, int y, int z, int face, bool bTestUseOnOnly=false, bool *pbUsedItem=NULL);
|
||||
virtual bool hasExperience();
|
||||
};
|
||||
@@ -79,7 +79,6 @@ wchar_t *Textures::preLoaded[TN_COUNT] =
|
||||
L"mob/silverfish",
|
||||
L"mob/enderman_eyes",
|
||||
L"misc/explosion",
|
||||
L"item/xporb",
|
||||
L"item/chest",
|
||||
L"item/largechest",
|
||||
|
||||
|
||||
@@ -72,7 +72,6 @@ typedef enum _TEXTURE_NAME
|
||||
TN_MOB_SILVERFISH,
|
||||
TN_MOB_ENDERMAN_EYES,
|
||||
TN_MISC_EXPLOSION,
|
||||
TN_ITEM_EXPERIENCE_ORB,
|
||||
TN_TILE_CHEST,
|
||||
TN_TILE_LARGE_CHEST,
|
||||
|
||||
|
||||
@@ -641,11 +641,6 @@ shared_ptr<Packet> TrackedEntity::getAddEntityPacket()
|
||||
return shared_ptr<AddEntityPacket>( new AddEntityPacket(e, AddEntityPacket::THROWN_POTION, ((dynamic_pointer_cast<ThrownPotion>(e))->getPotionValue()), yRotp, xRotp, xp, yp, zp));
|
||||
}
|
||||
break;
|
||||
case eTYPE_THROWNEXPBOTTLE:
|
||||
{
|
||||
return shared_ptr<AddEntityPacket>( new AddEntityPacket(e, AddEntityPacket::THROWN_EXPBOTTLE, yRotp, xRotp, xp, yp, zp) );
|
||||
}
|
||||
break;
|
||||
case eTYPE_THROWNENDERPEARL:
|
||||
{
|
||||
return shared_ptr<AddEntityPacket>( new AddEntityPacket(e, AddEntityPacket::THROWN_ENDERPEARL, yRotp, xRotp, xp, yp, zp) );
|
||||
@@ -754,11 +749,6 @@ shared_ptr<Packet> TrackedEntity::getAddEntityPacket()
|
||||
return packet;
|
||||
}
|
||||
break;
|
||||
case eTYPE_EXPERIENCEORB:
|
||||
{
|
||||
return shared_ptr<AddExperienceOrbPacket>( new AddExperienceOrbPacket(dynamic_pointer_cast<ExperienceOrb>(e)) );
|
||||
}
|
||||
break;
|
||||
default:
|
||||
assert(false);
|
||||
break;
|
||||
|
||||
Reference in new issue
Block a user